*************************************************************
* Title: 4_tables											*
* Authors: Peter Kuhn, Trevor Osaki, Lei Yue                *
* Purpose: Generate Tables used in paper and other results  *
* Date: September 2024                                      *
*************************************************************


********* PRELIMINARY SET-UP *********
version 16

* Set your directory where you store the data

	cap cd $homedir // replace this if you do not store your data under the $homedir
	cap cd "2_Main Analyses"

* IN
	loc DTA_MAIN        "d1_when_is_discrimination_unfair_data_set"
	loc DTA_ACS         "d5_acs2019_analysis"
	loc DTA_GSS         "d6_gss2020_analysis"
	loc DTA_POP         "d7_state_pop"
	loc DTA_OR_LABELS   "d8_open_response_handlabels.csv"
	
* OUT
	loc TAB_1	  	"Tables/Table_1.rtf"
	loc TAB_2	  	"Tables/Table_2.rtf"
	loc TAB_3	  	"Tables/Table_3.rtf"
	
	loc TAB_A2_1	"Tables/Table_A2_1.rtf"
	loc TAB_A2_2	"Tables/Table_A2_2.rtf"
	loc TAB_A2_3	"Tables/Table_A2_3.rtf"
	loc TAB_A2_4	"Tables/Table_A2_4.rtf"

	loc TAB_A4_3_1	"Tables/Table_A4_3_1.rtf"
	
	* First Scenario Only
	loc TAB_A5_1_1	"Tables/Table_A5_1_1.rtf"	// replicates Table 1
	loc TAB_A5_1_2	"Tables/Table_A5_1_2.rtf"
	* White Respondents Only
	loc TAB_A5_2_1	"Tables/Table_A5_2_1.rtf"
	loc TAB_A5_2_2	"Tables/Table_A5_2_2.rtf"	
	
	loc TAB_A6_1	"Tables/Table_A6_1.rtf"
	loc TAB_A6_2	"Tables/Table_A6_2.rtf"

	* ACS weights
	loc TAB_A8_1	"Tables/Table_A8_1.rtf"
	loc TAB_A8_2	"Tables/Table_A8_2.rtf" // replicates Table 1
	loc TAB_A8_3	"Tables/Table_A8_3.rtf" // replicates Table 2
	loc TAB_A8_4	"Tables/Table_A8_4.rtf" // replicates Table 3

	* GSS weights
	loc TAB_A9_1	"Tables/Table_A9_1.rtf" // political leaning
	loc TAB_A9_2	"Tables/Table_A9_2.rtf" // replicates Table 1
	loc TAB_A9_3	"Tables/Table_A9_3.rtf" // replicates Table 2
	loc TAB_A9_4	"Tables/Table_A9_4.rtf" // replicates Table 3
	
	* 'Thoughtful' Subjects Only
	loc TAB_A10_1	"Tables/Table_A10_1.rtf" 
	loc TAB_A10_2	"Tables/Table_A10_2.rtf" // replicates Table 1
	loc TAB_A10_3	"Tables/Table_A10_3.rtf" // replicates Table 2
	loc TAB_A10_4	"Tables/Table_A10_4.rtf" // replicates Table 3
	


/* BRING DATA: Main Dataset: d1_when_is_discrimination_unfair_data_set
------------------------------------------------------------------------------- */
use "`DTA_MAIN'", replace

/* GEN VARS
------------------------------------------------------------------------------- */
	* fair
	 lab var fair "Fairness Ratings"

	* taste
	 lab var taste "Taste-Based Discrimination"
	 lab def taste 1 "taste" 0 "stats"
	 lab val taste taste
	
	* discrim_type
	gen 	 discrim_type = (taste == 1)
	 replace discrim_type = 2 if stat == 1
	 lab var discrim_type "Type of Discrimination"
	 lab def discrim_type 1 "taste" 2 "stats"
	 lab val discrim_type discrim_type

	* low_just
	 lab var low_just "Low Justifiability"
	 lab def low_just 1 "less" 0 "more"
	 lab val low_just low_just
	 
	* justifiability
	gen 	 justifiability = (low_just == 1)
	 replace justifiability = 2 if low_just == 0
	 lab var justifiability "Justifiability"
	 lab def justifiability 1 "less" 2 "more"
	 lab val justifiability justifiability
	 
	* black
	 lab var black "Discriminatee Race: Black"
	 lab def black 1 "black" 0 "white"
	 lab val black black
	
	* white
	 lab var white "Discriminatee Race: White"
	 lab def white 0 "black" 1 "white"
	 lab val white white
	 
	* black * low_just
	gen 	 black_low = black*low_just
	 lab var black_low "Black Discriminatee x Low Justifiability"
	 
	* races (respondent's)
	gen 	 races = 1 if race_white == 1
	 replace races = 2 if race_black == 1
	 replace races = 3 if other == 1
	 lab var races "Respondent Race"
	 lab def races 1 "Respondent Race: white" 2 "Respondent Race: black" 3 "Respondent Race: others"
	 lab val races races
	 
	* leaning_num
	gen 	 leaning_num = (conserv == 1)
	 replace leaning_num = 2 if mod == 1
	 replace leaning_num = 3 if lib == 1
	 lab var leaning_num "Political Orientation"
	 lab def leaning_num 1 "Conservatives" 2 "Moderates" 3 "Liberals"
	 lab val leaning_num leaning_num
	 
	* black * lib
	gen 	 black_lib = black*lib 
	 lab var black_lib "Black Discriminatee x Liberals"
	 
	* lib2 
	gen 	 lib2 = (lib == 1 | mod == 1)
	 lab var lib2 "Moderates and Liberals"
	
	* black_lib2
	gen 	 black_lib2 = black*lib2
	 lab var black_lib2 "Black x (Moderates and Liberals)"

	* bro
	 lab var bro "BRO: Black peoples' Relative Economic Opportunity "
	
	* others
	gen age65_over = (age65_74 == 1 | age75_84 == 1 | age85 == 1)
	gen age25_44 = (age25_34 == 1 | age35_44 == 1)
	gen age45_over = (age45_54 == 1 | age55_64 == 1 | age65_74 == 1 | age75_84 == 1 | age85 == 1)
	gen race_non_white = (race_white == 0)
	gen education_hs_some_college = (education_hs == 1 | education_some_college)
	gen education_college_or_above = (education_hs_some_college == 0)
	
	 lab var male 				"Male"
	 lab var female 			"Female"
	 lab var race_white 		"White respondent"
	 lab var race_black 		"Black respondent"
	 lab var race_asian 		"Asian respondent"
	 lab var race_hispanic 		"Hispanic respondent"
	 lab var race_indigenous 	"American Indigenous respondent"
	 lab var race_islander 		"Pacific Islander respondent"
	 lab var race_other 		"Other race respondent"
	 lab var age18_24 			"Age 18-24"
	 lab var age25_34 			"Age 25-34"
	 lab var age35_44 			"Age 35-44"
	 lab var age45_54 			"Age 45-54"
	 lab var age55_64 			"Age 55-64"
	 lab var age65_over 		"Age 65 and over"
	 lab var education_hs 				"High School or less"
	 lab var education_some_college 	"2-year or some college"
	 lab var education_four_college 	"4-year college or university"
	 lab var education_higher 			"Higher degree"
	
	* Standardized Fairness Measures
	egen sfair = std(fair)
	egen sbro = std(bro)
	
	* 'thoughtful' sample
	gen thoughtful = (durationinseconds > 502)

		
	* region
	gen region = .
	replace region = 1 if ct == 1 | me == 1 | ma == 1 | nh == 1 | ri == 1 | vt == 1
	replace region = 2 if nj == 1 | ny == 1 | pa == 1
	replace region = 3 if ind == 1 | il == 1 | mi == 1 | oh == 1 | wi == 1 
	replace region = 4 if ia == 1 | ks == 1 | mn == 1 | mo == 1 | ne == 1 | nd == 1 | sd == 1
	replace region = 5 if de == 1 | dc == 1 | fl == 1 | ga == 1 | md == 1 | nc == 1 | sc == 1 | va == 1 | wv == 1
	replace region = 6 if al == 1 | ky == 1 | ms == 1 | tn == 1
	replace region = 7 if ar == 1 | la == 1 | ok == 1 | tx == 1
	replace region = 8 if az == 1 | co == 1 | id == 1 | nm == 1 | mt == 1 | ut == 1 | nv == 1 | wy == 1
	replace region = 9 if ak == 1 | ca == 1 | hi == 1 | or == 1 | wa == 1

	gen northeast = (region == 1|region == 2)
	gen new_england = (region == 1)
	gen mid_atlantic = (region == 2)

	gen midwest = (region == 3| region == 4)
	gen east_north_central = (region == 3)
	gen west_north_central = (region == 4)

	gen south = (region == 5 | region == 6 | region == 7)
	gen south_atlantic = (region == 5)
	gen east_south_central = (region == 6)
	gen west_south_central = (region == 7)

	gen west = (region == 8 | region == 9)
	gen mountain = (region == 8)
	gen pacific = (region == 9)
	
	
tempfile DATA_REG
save `DATA_REG', replace


/* ******************************** Main Paper ******************************** */

/* Table 1: Fairness Ratings by Treatment
------------------------------------------------------------------------------- */
use `DATA_REG', replace

	keep if stage_one == 1

	loc CLUSTER ", vce(cluster randomid)"
	
	* row 1: black
	estimates clear
	preserve
		eststo taste_1: mean 	fair 	if justifiability == 1 & taste == 1 & black == 1 `CLUSTER'
		eststo taste_2: mean 	fair 	if justifiability == 2 & taste == 1 & black == 1 `CLUSTER'
		eststo stats_1: mean 	fair 	if justifiability == 1 & taste == 0 & black == 1 `CLUSTER'
		eststo stats_2: mean 	fair 	if justifiability == 2 & taste == 0 & black == 1 `CLUSTER'
		eststo  comb_1: mean 	fair 	if justifiability == 1 				& black == 1 `CLUSTER'
		eststo  comb_2: mean 	fair 	if justifiability == 2 				& black == 1 `CLUSTER'
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "1. Black Discriminatees"
		eststo taste_3: reg tmp	fair 	if 				   		 taste == 1 & black == 1 `CLUSTER'
		eststo stats_3: reg tmp	fair 	if 				   		 taste == 0 & black == 1 `CLUSTER'
		eststo  comb_3: reg tmp	fair 	if 				   					  black == 1 `CLUSTER'

		#delim;
			esttab taste* stats* comb* using "`TAB_1'", replace 
				 noobs nocons label compress nonotes
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
							b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 title("Table 1: Fairness Ratings by Treatment")
				 mtitles(
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)" 
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)" 
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)") 
				 collabels(none)
				 mgroups("Taste-Based Discrimination" "Statistical Discrimination" "Taste and Statistical (combined)",              
						pattern(1 0 0 1 0 0 1 0 0))
				;
		#delim cr	
	restore
	
	
	* row 2: white
	estimates clear
	preserve
		eststo taste_1: mean 	fair 	if justifiability == 1 & taste == 1 & black == 0 `CLUSTER'
		eststo taste_2: mean 	fair 	if justifiability == 2 & taste == 1 & black == 0 `CLUSTER'	 
		eststo stats_1: mean 	fair 	if justifiability == 1 & taste == 0 & black == 0 `CLUSTER'
		eststo stats_2: mean 	fair 	if justifiability == 2 & taste == 0 & black == 0 `CLUSTER'	
		eststo  comb_1: mean 	fair 	if justifiability == 1 				& black == 0 `CLUSTER'
		eststo  comb_2: mean 	fair 	if justifiability == 2 				& black == 0 `CLUSTER'
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "2. White Discriminatees"
		eststo taste_3: reg tmp	fair 	if 				   		 taste == 1 & black == 0 `CLUSTER'
		eststo stats_3: reg tmp	fair 	if 				   		 taste == 0 & black == 0 `CLUSTER'
		eststo  comb_3: reg tmp	fair 	if 				   		 			  black == 0 `CLUSTER'
		
		#delim;
			esttab taste* stats* comb* using "`TAB_1'", append 	 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						 b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
						 b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
	restore

	* row 3: black - white
	estimates clear
	preserve
		lab var black "3. Gap (Black-White)"
		eststo  taste_1: reg 	fair black	if justifiability == 1 & taste == 1 `CLUSTER'
		eststo  taste_2: reg 	fair black	if justifiability == 2 & taste == 1 `CLUSTER'
		eststo  taste_3: reg 	black
		
		eststo  stats_1: reg 	fair black	if justifiability == 1 & taste == 0 `CLUSTER'
		eststo  stats_2: reg 	fair black	if justifiability == 2 & taste == 0 `CLUSTER'
		eststo  stats_3: reg 	black
		
		eststo  comb_1: reg 	fair black	if justifiability == 1	            `CLUSTER'
		eststo  comb_2: reg 	fair black	if justifiability == 2	            `CLUSTER'	
		eststo  comb_3: reg 	black

		#delim;
			esttab taste* stats* comb* using "`TAB_1'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						 b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
						 b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
		
	restore	
	
	* row 4: all
	estimates clear
	preserve
		eststo taste_1: mean	fair 	if justifiability == 1 & taste == 1 `CLUSTER'
		eststo taste_2: mean	fair 	if justifiability == 2 & taste == 1 `CLUSTER'	 
		eststo stats_1: mean	fair 	if justifiability == 1 & taste == 0 `CLUSTER'
		eststo stats_2: mean	fair 	if justifiability == 2 & taste == 0 `CLUSTER'	
		eststo  comb_1: mean	fair 	if justifiability == 1	            `CLUSTER'
		eststo  comb_2: mean	fair 	if justifiability == 2	            `CLUSTER'	
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		lab var fair "4. All Discriminatees"
		eststo taste_3: reg tmp	fair 	if 				   		 taste == 1 `CLUSTER'
		eststo stats_3: reg tmp	fair 	if 				   		 taste == 0 `CLUSTER'
		eststo  comb_3: reg tmp	fair 									    `CLUSTER'
		
		#delim;
			esttab taste* stats* comb*  using "`TAB_1'", append 	 
				 noobs nocons label compress
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						 b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
						 b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 collabels(none)
				
				 addnotes("*** p<0.01; ** p<0.05; * p<0.10.")     
				;
		#delim cr	
	restore
	
	** footnotes
	reg fair black low_just black_low `CLUSTER'
	mat list r(table)
	loc INT_PValues: di %6.3f r(table)[4,3] // p = 0.679 (Difference in justifiability gap)
	di "Footnote: a test for equality of the Less versus More Justifiability Gap between the Black and White treatment yields p=`INT_PValues'."
	

	
/* Table 2: The Discriminatee Race Effect and Justifiability Premium by Political Orientation
------------------------------------------------------------------------------- */
use `DATA_REG', replace
	
	keep if stage_one == 1

	loc CLUSTER ", vce(cluster randomid)"

	* row 1: black
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if justifiability == 1 & leaning_num == 1 & black == 1
		eststo  con_2: mean 	fair 	if justifiability == 2 & leaning_num == 1 & black == 1
		eststo  mod_1: mean 	fair 	if justifiability == 1 & leaning_num == 2 & black == 1
		eststo  mod_2: mean 	fair 	if justifiability == 2 & leaning_num == 2 & black == 1
		eststo  lib_1: mean 	fair 	if justifiability == 1 & leaning_num == 3 & black == 1
		eststo  lib_2: mean 	fair 	if justifiability == 2 & leaning_num == 3 & black == 1
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "1. Black Discriminatees"
		eststo  con_3: reg tmp	fair 	if 				   		 leaning_num == 1 & black == 1 `CLUSTER'
		eststo  mod_3: reg tmp	fair 	if 				   		 leaning_num == 2 & black == 1 `CLUSTER'
		eststo  lib_3: reg tmp	fair 	if 				   		 leaning_num == 3 & black == 1 `CLUSTER'

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_2'", replace 
				 noobs nocons label compress nonotes
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 title("Table 2: The Discriminatee Race Effect and Justifiability Premium by Political Orientation")
				 mtitles(
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 ) 
				 collabels(none)
				 mgroups("Conservatives" "Moderates" "Liberals", 
						pattern(1 0 0  1 0 0  1 0 0 ))
				;
		#delim cr	
	restore
	
	* row 2: white
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if justifiability == 1 & leaning_num == 1 & black == 0
		eststo  con_2: mean 	fair 	if justifiability == 2 & leaning_num == 1 & black == 0
		eststo  mod_1: mean 	fair 	if justifiability == 1 & leaning_num == 2 & black == 0
		eststo  mod_2: mean 	fair 	if justifiability == 2 & leaning_num == 2 & black == 0
		eststo  lib_1: mean 	fair 	if justifiability == 1 & leaning_num == 3 & black == 0
		eststo  lib_2: mean 	fair 	if justifiability == 2 & leaning_num == 3 & black == 0
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "2. White Discriminatees"
		eststo  con_3: reg tmp	fair 	if 				   		 leaning_num == 1 & black == 0 `CLUSTER'
		eststo  mod_3: reg tmp	fair 	if 				   		 leaning_num == 2 & black == 0 `CLUSTER'
		eststo  lib_3: reg tmp	fair 	if 				   		 leaning_num == 3 & black == 0 `CLUSTER'

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_2'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
	restore
	
	* row 3: black - white
	estimates clear
	preserve
		lab var black "3. Gap (Black-White)"
		eststo  con_1: reg 	fair black	if justifiability == 1 & leaning_num == 1
		eststo  con_2: reg 	fair black	if justifiability == 2 & leaning_num == 1
		eststo  con_3: reg 	black
		
		eststo  mod_1: reg 	fair black	if justifiability == 1 & leaning_num == 2
		eststo  mod_2: reg 	fair black	if justifiability == 2 & leaning_num == 2
		eststo  mod_3: reg 	black
		
		eststo  lib_1: reg 	fair black	if justifiability == 1 & leaning_num == 3
		eststo  lib_2: reg 	fair black	if justifiability == 2 & leaning_num == 3
		eststo  lib_3: reg 	black

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_2'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
		
	restore	
	

	* row 4: all
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if justifiability == 1 & leaning_num == 1
		eststo  con_2: mean 	fair 	if justifiability == 2 & leaning_num == 1
		eststo  mod_1: mean 	fair 	if justifiability == 1 & leaning_num == 2
		eststo  mod_2: mean 	fair 	if justifiability == 2 & leaning_num == 2
		eststo  lib_1: mean 	fair 	if justifiability == 1 & leaning_num == 3
		eststo  lib_2: mean 	fair 	if justifiability == 2 & leaning_num == 3
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "4. All Discriminatees"
		eststo  con_3: reg tmp	fair 	if 				   		 leaning_num == 1 `CLUSTER'
		eststo  mod_3: reg tmp	fair 	if 				   		 leaning_num == 2 `CLUSTER'
		eststo  lib_3: reg tmp	fair 	if 				   		 leaning_num == 3 `CLUSTER'

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_2'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				 addnotes("*** p<0.01; ** p<0.05; * p<0.10.")  
				;
		#delim cr	
	restore

	** footnotes: equality of the discriminatee race effect (i.e., the Black treatment) between moderates and liberals
	reg fair black lib black_lib if lib == 1 |mod == 1 `CLUSTER'
	loc INT_PValues1: di %6.3f r(table)[4,3] // p = 0.567
	di "Footnote: A test for equality of the discriminatee race effect (i.e., the Black treatment) between moderate and liberal respondents yields p =`INT_PValues1'." 

	** footnotes: equality between conservatives and (moderates + liberals) 
	reg fair black lib2 black_lib2 `CLUSTER'
	loc INT_PValues2: di %6.3f r(table)[4,3] // p = 0.001
	di "Footnote: A test for equality of the discriminatee race effect between conservatives and (moderates + liberals) yields p =`INT_PValues2'."

	** footnotes: equality of the Less versus More Justifiability Gap across Conservatives, Moderates, and Liberals
	qui reg fair low_just if conserv == 1
		est store a
	qui reg fair low_just if mod == 1
		est store b
	qui reg fair low_just if lib == 1
		est store c 
	suest a b c `CLUSTER'
	test [a_mean]low_just = [b_mean]low_just = [c_mean]low_just
	loc EQUAL_PValues: di %6.3f `r(p)'  //p = 0.590
	di "Footnote: A test for equality of the Less versus More Justifiability Gap across Conservatives, Moderates, and Liberals yields p =`EQUAL_PValues'."
	


	
/* Table 3: Respondents' Perception of Black People's Relative Economic Opportunities (BRO) by Political Leaning
-------------------------------------------------------------------------------	*/
use `DATA_REG', replace

	keep if stage_one == 1

	loc CLUSTER ", vce(cluster randomid)"

	estimates clear
	
	preserve
		lab var bro "BRO"
		eststo bro1: mean bro if leaning_num == 1 `CLUSTER'
		eststo bro2: mean bro if leaning_num == 2 `CLUSTER'
		eststo bro3: mean bro if leaning_num == 3 `CLUSTER'


		** footnotes: equality of the Less versus More Justifiability Gap across Conservatives, Moderates, and Liberals
		reg bro conserv if lib == 0 `CLUSTER'
		loc P_CON_MOD: di %6.3f r(table)[4,1] // p = 0.000
		
		reg bro mod  if conserv == 0 `CLUSTER'
		loc P_MOD_LIB: di %6.3f r(table)[4,1] // p = 0.001

		reg bro lib if mod == 0 `CLUSTER'
		loc P_LIB_CON: di %6.3f r(table)[4,1] // p = 0.000

		qui reg bro conserv if lib == 0
			est store a
		qui reg bro mod if conserv == 0
			est store b
		qui reg bro lib if mod == 0
			est store c
		suest a b c `CLUSTER'
		test [a_lnvar]_cons = [b_lnvar]_cons = [c_lnvar]_cons
		loc P_THREE: di %6.3f `r(p)'	// p = 0.577
		
		#delim;
			esttab bro* using "`TAB_3'", replace 
				 nocons label compress nonotes
				 stats(N, fmt(%7.0fc) labels("Num. obs."))
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						  b(fmt(3) pattern(1 1 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 1) par)
					   "
					  )
				 title("Table 3: Respondents' Perception of Black People's Relative Economic Opportunities (BRO) by Political Leaning")
				 mtitles("Conservatives" "Moderates" "Liberals")
				 collabels(none)
				 mgroups("Political Leaning",              
						pattern(1 0 0))
				 addnotes(" " 
				 "*** p<0.01; ** p<0.05; * p<0.10."
				 "Notes: BRO is the respondent's assessment of Black peoples' relative economic opportunity on a scale of -3 (much less) to 3 (much more). Results are based on Stage 1 observations only. p-values are clustered by respondent." ""
				 "p-values for tests of equality are:"
				 "    Conservatives vs. Moderates: p=`P_CON_MOD';"
				 "    Moderates vs. Liberals: p=`P_MOD_LIB';"
				 "    Liberals vs. Conservatives: p=`P_LIB_CON';"
				 "    Across all three political groups: p=`P_THREE'."
				 )  
				;
		#delim cr	
	restore 



/* ******************************** Appendix 2 ******************************** */

/* Table A2.1: Demographic Composition of MTurk Sample versus the American Community Survey (ACS)
------------------------------------------------------------------------------- */
use `DATA_REG', replace

	estimates clear
		
		* (1) MTurk
		collapse (mean) male female race_white race_black race_asian race_hispanic race_indigenous race_islander race_other age18_24 age25_34 age35_44 age45_54 age55_64 age65_over education_hs education_some_college education_four_college education_higher, by (randomid)

		eststo mturk: estpost sum male female race_white race_black race_asian race_hispanic race_indigenous race_islander race_other age18_24 age25_34 age35_44 age45_54 age55_64 age65_over education_hs education_some_college education_four_college education_higher 
		
		* (2) ACS
		use "`DTA_ACS'", replace
		eststo acs: estpost sum male female race_white race_black race_asian race_hispanic race_indigenous race_islander race_other age18_24 age25_34 age35_44 age45_54 age55_64 age65_over education_hs education_some_college education_four_college education_higher 

		
	#delim ;
		esttab mturk acs using "`TAB_A2_1'", replace 
			label legend
				   
			cells("mean(fmt(3))")
			stats(N, fmt(%10.0fc) labels("Observations"))
			
			coeflabels(
						male "Male" 
						female "Female" 
						race_white "White respondent" 
						race_black "Black respondent" 
						race_asian "Asian respondent" 
						race_hispanic "Hispanic respondent" 
						race_indigenous "American Indigenous respondent" 
						race_islander "Pacific Islander respondent" 
						race_other "Other race respondent"
						age18_24 "Age 18-24" 
						age25_34 "Age 25-34"  
						age35_44 "Age 35-44" 
						age45_54 "Age 45-54" 
						age55_64 "Age 55-64"  
						age65_over "Age 65 and over"
						education_hs "High School or less" 
						education_some_college "2-year or some college" 
						education_four_college "4-year college or university"  
						education_higher "Higher degree"			
						)
			
			title("Table A2.1: Demographic Composition of MTurk Sample versus the American Community Survey (ACS)")

			mgroups("MTurk Sample" "2019 ACS Sample", pattern(1 1))
			
			collabels(none)
			nomtitles
			
			addnotes(" " "Notes: Column 1 contains the percentage of respondents across various demographic characteristics within the MTurk sample. Column 2 contains these percentages for the 2019 American Community Survey (ACS) sample for comparison.  The racial categories in our ACS data use the mutually exclusive categories derived by Center for Economic and Policy Research (CEPR)  (variable wbhapo), which match our own survey question.")        
			
			;
	#delim cr



/* Table A2.2: Composition of MTurk Sample versus the General Social Survey (GSS), by Political Leaning
------------------------------------------------------------------------------- */
use `DATA_REG', replace

	estimates clear

		* (1) MTurk
		collapse (mean) party_democrat party_republican party_independent party_other extremely_conservative conservative slightly_conservative moderate slightly_liberal liberal extremely_liberal, by (randomid)
		eststo mturk: estpost sum extremely_conservative conservative slightly_conservative moderate slightly_liberal liberal extremely_liberal
		 
		* (2) GSS
		use "`DTA_GSS'", replace
		eststo gss: estpost sum extremely_conservative conservative slightly_conservative moderate slightly_liberal liberal extremely_liberal
		

	#delim ;
		esttab mturk gss using "`TAB_A2_2'", replace 
			label legend
				   
			cells("mean(fmt(3))")
			stats(N, fmt(%10.0fc) labels("Observations"))
			
			coeflabels(
					   extremely_conservative "Extremely conservative"
					   conservative "Conservative"
					   slightly_conservative "Slightly conservative"
					   moderate "Moderate"
					   slightly_liberal "Slightly liberal"
					   liberal "Liberal"
					   extremely_liberal "Extremely liberal"
					  )
			
			title("Table A2.2: Composition of MTurk Sample versus the General Social Survey (GSS), by Political Leaning")

			mgroups("MTurk Sample" "GSS Sample", pattern(1 1))
			
			collabels(none)
			nomtitles
			
			addnotes(" " "Notes: Column 1 contains the percentage of respondents by political leaning while Column 2 contains that of the 2020 GSS. Our political party preference question is not comparable to the GSS. The only difference between our political leaning question and the GSS is in the phrasing of the middle category:"

			"Our political leaning question asks for 'political views' on this seven-point scale:"
			"extremely liberal; liberal; slightly liberal moderate;"
			"slightly conservative;"
			"conservative; extremely conservative"
			
			"The GSS political leaning question ask for 'political views' on this seven-point scale:"
			"extremely liberal; liberal; slightly liberal"
			"moderate, middle of the road;"
			"slightly conservative; conservative; extremely conservative")
			
			;
	#delim cr
	
	
/* Table A2.3: Composition of MTurk Sample by Census Region
------------------------------------------------------------------------------- */	
use `DATA_REG', replace

	estimates clear

		* (1) MTurk
		collapse (mean) northeast new_england mid_atlantic midwest east_north_central west_north_central south south_atlantic east_south_central west_south_central west mountain pacific, by (randomid)
		
		eststo mturk: estpost sum northeast new_england mid_atlantic midwest east_north_central west_north_central south south_atlantic east_south_central west_south_central west mountain pacific
		
	 * (2) ACS
		use "`DTA_ACS'", replace
		
		eststo acs: estpost sum northeast new_england mid_atlantic midwest east_north_central west_north_central south south_atlantic east_south_central west_south_central west mountain pacific

		
	#delim ;
		esttab mturk acs using "`TAB_A2_3'", replace 
			label legend
				   
			cells("mean(fmt(3))")
			stats(N, fmt(%10.0fc) labels("Observations"))
			
			coeflabels(
					   northeast "Northeast" new_england "  New England" mid_atlantic "  Middle Atlantic" 
					   midwest "Midwest" east_north_central "  East North Central" west_north_central "  West North Central"
					   south "South" south_atlantic "  South Atlantic" east_south_central "  East South Central" west_south_central "  West South Central"
					   west "West" mountain "  Mountain" pacific "  Pacific"
					  )
			
			title("Table A2.3: Composition of MTurk Sample by Census Region")

			mgroups("MTurk Sample" "2019 ACS Sample", pattern(1 1))
			nomtitles
			
			collabels(none)
			
			addnotes(" " "Notes: Column 1 contains the percentage of respondents across U.S. census regions and their respective divisions. Column 2 contains these percentages for the 2019 American Community Survey (ACS) sample for comparison.")        
			
			;
	#delim cr	
	
	
	
/* Table A2.4: Composition of MTurk Sample versus ACS by U.S. State (pop. exceeds 5 million)
------------------------------------------------------------------------------- */	
use `DATA_REG', replace

	estimates clear

		keep if az ==1 | ca == 1 | fl == 1 | ga == 1 | il == 1 | ind == 1 | ma == 1 | mi == 1 | nj == 1 | ny == 1 | nc == 1| oh == 1 | oh == 1 | pa == 1 | tn == 1 | tx == 1 | va == 1 | wa == 1

		* (1) MTurk shares
		collapse (mean) az ca fl ga il ind ma mi nj ny nc oh pa tn tx va wa, by (randomid)
		eststo mturk_shares: estpost sum az ca fl ga il ind ma mi nj ny nc oh pa tn tx va wa
		estadd scalar N_obs=e(N)
		
		* (2) MTurk count
		eststo mturk_count: estpost sum az ca fl ga il ind ma mi nj ny nc oh pa tn tx va wa
		estadd scalar N_obs=e(N)
		
		* (3) ACS shares
		use "`DTA_ACS'", replace
		eststo acs_shares: estpost sum az ca fl ga il ind ma mi nj ny nc oh pa tn tx va wa
		estadd scalar N_obs=e(N)
		
		* (4) State Pop in thoudsands
		use "`DTA_POP'", replace
		foreach s in az ca fl ga il ind ma mi nj ny nc oh pa tn tx va wa{
			replace `s' = pop if `s' == 1
		}
		eststo pop: estpost sum az ca fl ga il ind ma mi nj ny nc oh pa tn tx va wa
		estadd scalar N_obs=.
		

	#delim ;
		esttab mturk_shares mturk_count acs_shares pop using "`TAB_A2_4'", replace 
			label legend noobs
				   
			cells("mean(fmt(3) pattern(1 0 1 0)) sum(fmt(%10.0fc) pattern(0 1 0 1))")
			
			stats(N, fmt(%10.0fc) labels("Observations"))
			
			title("Table A2.4: Composition of MTurk Sample versus ACS by U.S. State (pop. exceeds 5 million)")
			
			coeflabels(
						az "Arizona"
						ca "California"
						fl "Florida"
						ga "Georgia"
						il "Illinois"
						ind "Indiana"
						ma "Massachusetts"
						mi "Michigan"
						nj "New Jersey"
						ny "New York"
						nc "North Carolina"
						oh "Ohio"
						pa "Pennsylvania"
						tn "Tennessee"
						tx "Texas"
						va "Virginia"
						wa "Washington"
					   )

			mtitles("MTurk Sample" "MTurk Sample" "2019 ACS Sample" "Stat Pop.")
							
			collabels("{\i shares}" "{\i count}" "{\i in thousands}")
			
			addnotes(" " "Notes: Column 1 contains the percentage of respondents across U.S. states with adult populations of at least 5 million. Column 2 contains the raw number of MTurk respondents from each state. Column 3 contains the percentages for the 2019 American Community Survey (ACS) sample for comparison. Column 4 contains the 2019 state populations (in thousands) of those at least 18 years of age.")
			
			;
	#delim cr

	


/* ******************************** Appendix 4 ******************************** */

/* Table A4.3.1: Fairness Ratings by Respondent Race and Discriminatee Race
 * These numbers were previously in Figure 4
------------------------------------------------------------------------------- */
use `DATA_REG', replace

	keep if stage_one == 1
	
	loc CLUSTER ", vce(cluster randomid)"
	
	* row 1: black
	estimates clear
	preserve
		lab var fair "1. Black Discriminatees"
		eststo: mean fair if black == 1 & races == 1 `CLUSTER'
		eststo: mean fair if black == 1 & races == 2 `CLUSTER'
		eststo: mean fair if black == 1 & races == 3 `CLUSTER'
		eststo: mean fair if black == 1 			 `CLUSTER'
		
		#delim;
			esttab * using "`TAB_A4_3_1'", replace 
				 noobs nocons label compress nonotes
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 stats(N, fmt(%7.0fc) labels("Num. obs."))
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						  b(fmt(3) pattern(1 1 1 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 1 1) par)
					   "
					  )
				 title("Table A4.3.1: Fairness Ratings by Respondent Race and Discriminatee Race")
				 mtitles(
				 "White Respondents" "Black Respondents" "Other Race Respondents" "All Respondents") 
				 collabels(none)
				 mgroups( "Respondent Race",              
						pattern(1 0 0))
				;
		#delim cr	
	restore
	
	* row 2: white
	estimates clear
	preserve
		lab var fair "2. White Discriminatees"
		eststo: mean fair if black == 0 & races == 1 `CLUSTER'
		eststo: mean fair if black == 0 & races == 2 `CLUSTER'
		eststo: mean fair if black == 0 & races == 3 `CLUSTER'
		eststo: mean fair if black == 0 			 `CLUSTER'
	
		#delim;
			esttab * using "`TAB_A4_3_1'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 stats(N, fmt(%7.0fc) labels("Num. obs."))
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						  b(fmt(3) pattern(1 1 1 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 1 1) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
	restore
	
	** footnotes: equality of the discriminatee race effect 
	qui reg fair black if races == 1 
		est store a
	qui reg fair black if races == 2 
		est store b
	qui reg fair black if races == 3 
		est store c
	suest a b c `CLUSTER'
	test [a_mean]black = [b_mean]black = [c_mean]black
	
	loc EQUAL_PValues: di %6.3f `r(p)'	// 0.739
	di "`EQUAL_PValues'"
	
	* row 3: black - white
	estimates clear
	preserve
		lab var black "3. Gap (Black-White)"
		eststo: reg fair black if races == 1 `CLUSTER'
		eststo: reg fair black if races == 2 `CLUSTER'
		eststo: reg fair black if races == 3 `CLUSTER'
		eststo: reg fair black 				 `CLUSTER'
	
		#delim;
			esttab * using "`TAB_A4_3_1'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 stats(N, fmt(%7.0fc) labels("Num. obs."))
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						  b(fmt(3) pattern(1 1 1 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 1 1) par)
					   "
					  )
				 collabels(none)
				 addnotes(" " "Notes: Results are based on Stage 1 observations only. p-values are clustered by respondent. *** p<0.01; ** p<0.05; * p<0.10." 
				 "A test for equality of the discriminatee race effect (i.e., the Black treatment) across all three racial groups yields p =`EQUAL_PValues'.")  
				;
		#delim cr	
	restore
	



/* ******************************** Appendix 5 ******************************** */


/* Table A5.1.1: Replicates Table 1 for First Scenario Only
------------------------------------------------------------------------------- */ 
use `DATA_REG', replace

	keep if stage_one == 1
	keep if ordering == 1
	assert stage_one == 1
	
	loc CLUSTER "" // only one obs for each randomid

	* row 1: black
	estimates clear
	preserve
		eststo taste_1: mean 	fair 	if justifiability == 1 & taste == 1 & black == 1 `CLUSTER'
		eststo taste_2: mean 	fair 	if justifiability == 2 & taste == 1 & black == 1 `CLUSTER'
		eststo stats_1: mean 	fair 	if justifiability == 1 & taste == 0 & black == 1 `CLUSTER'
		eststo stats_2: mean 	fair 	if justifiability == 2 & taste == 0 & black == 1 `CLUSTER'
		eststo  comb_1: mean 	fair 	if justifiability == 1 				& black == 1 `CLUSTER'
		eststo  comb_2: mean 	fair 	if justifiability == 2 				& black == 1 `CLUSTER'
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "1. Black Discriminatees"
		eststo taste_3: reg tmp	fair 	if 				   		 taste == 1 & black == 1 `CLUSTER'
		eststo stats_3: reg tmp	fair 	if 				   		 taste == 0 & black == 1 `CLUSTER'
		eststo  comb_3: reg tmp	fair 	if 				   					  black == 1 `CLUSTER'

		#delim;
			esttab taste* stats* comb* using "`TAB_A5_1_1'", replace 
				 noobs nocons label compress nonotes
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
							b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 title("Table A5.1.1: Fairness Ratings by Treatment: First Scenario Only")
				 mtitles(
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)" 
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)" 
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)") 
				 collabels(none)
				 mgroups("Taste-Based Discrimination" "Statistical Discrimination" "Taste and Statistical (combined)",              
						pattern(1 0 0 1 0 0 1 0 0))
				;
		#delim cr	
	restore
	
	
	* row 2: white
	estimates clear
	preserve
		eststo taste_1: mean 	fair 	if justifiability == 1 & taste == 1 & black == 0 `CLUSTER'
		eststo taste_2: mean 	fair 	if justifiability == 2 & taste == 1 & black == 0 `CLUSTER'	 
		eststo stats_1: mean 	fair 	if justifiability == 1 & taste == 0 & black == 0 `CLUSTER'
		eststo stats_2: mean 	fair 	if justifiability == 2 & taste == 0 & black == 0 `CLUSTER'	
		eststo  comb_1: mean 	fair 	if justifiability == 1 				& black == 0 `CLUSTER'
		eststo  comb_2: mean 	fair 	if justifiability == 2 				& black == 0 `CLUSTER'
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "2. White Discriminatees"
		eststo taste_3: reg tmp	fair 	if 				   		 taste == 1 & black == 0 `CLUSTER'
		eststo stats_3: reg tmp	fair 	if 				   		 taste == 0 & black == 0 `CLUSTER'
		eststo  comb_3: reg tmp	fair 	if 				   		 			  black == 0 `CLUSTER'
		
		#delim;
			esttab taste* stats* comb* using "`TAB_A5_1_1'", append 	 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						 b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
						 b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
	restore

	* row 3: black - white
	estimates clear
	preserve
		lab var black "3. Gap (Black-White)"
		eststo  taste_1: reg 	fair black	if justifiability == 1 & taste == 1 `CLUSTER'
		eststo  taste_2: reg 	fair black	if justifiability == 2 & taste == 1 `CLUSTER'
		eststo  taste_3: reg 	black
		
		eststo  stats_1: reg 	fair black	if justifiability == 1 & taste == 0 `CLUSTER'
		eststo  stats_2: reg 	fair black	if justifiability == 2 & taste == 0 `CLUSTER'
		eststo  stats_3: reg 	black
		
		eststo  comb_1: reg 	fair black	if justifiability == 1	            `CLUSTER'
		eststo  comb_2: reg 	fair black	if justifiability == 2	            `CLUSTER'	
		eststo  comb_3: reg 	black

		#delim;
			esttab taste* stats* comb* using "`TAB_A5_1_1'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						 b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
						 b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
		
	restore	
	
	* row 4: all
	estimates clear
	preserve
		eststo taste_1: mean	fair 	if justifiability == 1 & taste == 1 `CLUSTER'
		eststo taste_2: mean	fair 	if justifiability == 2 & taste == 1 `CLUSTER'	 
		eststo stats_1: mean	fair 	if justifiability == 1 & taste == 0 `CLUSTER'
		eststo stats_2: mean	fair 	if justifiability == 2 & taste == 0 `CLUSTER'	
		eststo  comb_1: mean	fair 	if justifiability == 1	            `CLUSTER'
		eststo  comb_2: mean	fair 	if justifiability == 2	            `CLUSTER'	
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		lab var fair "4. All Discriminatees"
		eststo taste_3: reg tmp	fair 	if 				   		 taste == 1 `CLUSTER'
		eststo stats_3: reg tmp	fair 	if 				   		 taste == 0 `CLUSTER'
		eststo  comb_3: reg tmp	fair 									    `CLUSTER'
		
		#delim;
			esttab taste* stats* comb*  using "`TAB_A5_1_1'", append 	 
				 noobs nocons label compress
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						 b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
						 b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 collabels(none)
				
				 addnotes("*** p<0.01; ** p<0.05; * p<0.10.")     
				;
		#delim cr	
	restore
	
	** footnotes
	reg fair taste `CLUSTER'
	loc INT_PValues: di %6.3f r(table)[4,1] // p = .564
	di "Footnote: Taste-based vs. statistical discrimination p=`INT_PValues'."
	
	reg fair black if low_just == 1 `CLUSTER'
	loc INT_PValues: di %6.3f r(table)[4,1] // p = .008
	di "Footnote: For less justifiable scenarios, Black versus White Treatment, p=`INT_PValues'."

	reg fair black if low_just == 0 `CLUSTER'
	loc INT_PValues: di %6.3f r(table)[4,1] // p = .000
	di "Footnote: For more justifiable scenarios, Black versus White Treatment, p=`INT_PValues'."
	
	reg fair black low_just black_low `CLUSTER'
	loc INT_PValues: di %6.3f r(table)[4,3] // p = .590
	di "Footnote: Less versus More Justifiability Gap equality across Black versus White treatment, p=`INT_PValues'."


/* Table A5.1.2: Replicates Table 2 for First Scenario Only
------------------------------------------------------------------------------- */	
use `DATA_REG', replace

	keep if stage_one == 1
	keep if ordering == 1
	assert stage_one == 1
	
	loc CLUSTER "" // only one obs for each randomid

	* row 1: black
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if justifiability == 1 & leaning_num == 1 & black == 1
		eststo  con_2: mean 	fair 	if justifiability == 2 & leaning_num == 1 & black == 1
		eststo  mod_1: mean 	fair 	if justifiability == 1 & leaning_num == 2 & black == 1
		eststo  mod_2: mean 	fair 	if justifiability == 2 & leaning_num == 2 & black == 1
		eststo  lib_1: mean 	fair 	if justifiability == 1 & leaning_num == 3 & black == 1
		eststo  lib_2: mean 	fair 	if justifiability == 2 & leaning_num == 3 & black == 1
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "1. Black Discriminatees"
		eststo  con_3: reg tmp	fair 	if 				   		 leaning_num == 1 & black == 1
		eststo  mod_3: reg tmp	fair 	if 				   		 leaning_num == 2 & black == 1
		eststo  lib_3: reg tmp	fair 	if 				   		 leaning_num == 3 & black == 1

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A5_1_2'", replace 
				 noobs nocons label compress nonotes
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 title("Table A5.1.2: The Discriminatee Race Effect and Justifiability Premium by Political Orientation: First Scenario Only")
				 mtitles(
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 ) 
				 collabels(none)
				 mgroups("Conservatives" "Moderates" "Liberals", 
						pattern(1 0 0  1 0 0  1 0 0 ))
				;
		#delim cr	
	restore
	
	* row 2: white
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if justifiability == 1 & leaning_num == 1 & black == 0
		eststo  con_2: mean 	fair 	if justifiability == 2 & leaning_num == 1 & black == 0
		eststo  mod_1: mean 	fair 	if justifiability == 1 & leaning_num == 2 & black == 0
		eststo  mod_2: mean 	fair 	if justifiability == 2 & leaning_num == 2 & black == 0
		eststo  lib_1: mean 	fair 	if justifiability == 1 & leaning_num == 3 & black == 0
		eststo  lib_2: mean 	fair 	if justifiability == 2 & leaning_num == 3 & black == 0
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "2. White Discriminatees"
		eststo  con_3: reg tmp	fair 	if 				   		 leaning_num == 1 & black == 0
		eststo  mod_3: reg tmp	fair 	if 				   		 leaning_num == 2 & black == 0
		eststo  lib_3: reg tmp	fair 	if 				   		 leaning_num == 3 & black == 0

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A5_1_2'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
	restore
	
	* row 3: black - white
	estimates clear
	preserve
		lab var black "3. Gap (Black-White)"
		eststo  con_1: reg 	fair black	if justifiability == 1 & leaning_num == 1
		eststo  con_2: reg 	fair black	if justifiability == 2 & leaning_num == 1
		eststo  con_3: reg 	black
		
		eststo  mod_1: reg 	fair black	if justifiability == 1 & leaning_num == 2
		eststo  mod_2: reg 	fair black	if justifiability == 2 & leaning_num == 2
		eststo  mod_3: reg 	black
		
		eststo  lib_1: reg 	fair black	if justifiability == 1 & leaning_num == 3
		eststo  lib_2: reg 	fair black	if justifiability == 2 & leaning_num == 3
		eststo  lib_3: reg 	black

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A5_1_2'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
		
	restore	
	
	
	* row 4: all
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if justifiability == 1 & leaning_num == 1
		eststo  con_2: mean 	fair 	if justifiability == 2 & leaning_num == 1
		eststo  mod_1: mean 	fair 	if justifiability == 1 & leaning_num == 2
		eststo  mod_2: mean 	fair 	if justifiability == 2 & leaning_num == 2
		eststo  lib_1: mean 	fair 	if justifiability == 1 & leaning_num == 3
		eststo  lib_2: mean 	fair 	if justifiability == 2 & leaning_num == 3
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "4. All Discriminatees"
		eststo  con_3: reg tmp	fair 	if 				   		 leaning_num == 1
		eststo  mod_3: reg tmp	fair 	if 				   		 leaning_num == 2
		eststo  lib_3: reg tmp	fair 	if 				   		 leaning_num == 3

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A5_1_2'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				 addnotes("*** p<0.01; ** p<0.05; * p<0.10.")  
				;
		#delim cr	
	restore


	** footnotes: equality of the discriminatee race effect (i.e., the Black treatment) between moderates and liberals
	reg fair black lib black_lib if lib == 1 |mod == 1
	loc INT_PValues1: di %6.3f r(table)[4,3] // p = 0.059
	di "Footnote: A test for equality of the discriminatee race effect (i.e., the Black treatment) between moderate and liberal respondents yields p =`INT_PValues1'." 

	** footnotes: equality between conservatives and (moderates + liberals) 
	reg fair black lib2 black_lib2 
	loc INT_PValues2: di %6.3f r(table)[4,3] // p = 0.007
	di "Footnote: A test for equality of the discriminatee race effect between conservatives and (moderates + liberals) yields p =`INT_PValues2'."

	** footnotes: equality of the Less versus More Justifiability Gap across Conservatives, Moderates, and Liberals
	qui reg fair low_just if conserv == 1 
		est store a
	qui reg fair low_just if mod == 1
		est store b
	qui reg fair low_just if lib == 1
		est store c 
	suest a b c 
	test [a_mean]low_just = [b_mean]low_just = [c_mean]low_just
	loc EQUAL_PValues: di %6.3f `r(p)'  //p = 0.266
	di "Footnote: A test for equality of the Less versus More Justifiability Gap across Conservatives, Moderates, and Liberals yields p =`EQUAL_PValues'."
		


/* Table A5.2.1: Replicates Table 2 for White Respondents Only
------------------------------------------------------------------------------- */
use `DATA_REG', replace

	keep if race_white == 1
	keep if stage_one == 1
	assert stage_one == 1
	
	loc CLUSTER ", vce(cluster randomid)"
	
	* row 1: black
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if justifiability == 1 & leaning_num == 1 & black == 1
		eststo  con_2: mean 	fair 	if justifiability == 2 & leaning_num == 1 & black == 1
		eststo  mod_1: mean 	fair 	if justifiability == 1 & leaning_num == 2 & black == 1
		eststo  mod_2: mean 	fair 	if justifiability == 2 & leaning_num == 2 & black == 1
		eststo  lib_1: mean 	fair 	if justifiability == 1 & leaning_num == 3 & black == 1
		eststo  lib_2: mean 	fair 	if justifiability == 2 & leaning_num == 3 & black == 1
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "1. Black Discriminatees"
		eststo  con_3: reg tmp	fair 	if 				   		 leaning_num == 1 & black == 1 `CLUSTER'
		eststo  mod_3: reg tmp	fair 	if 				   		 leaning_num == 2 & black == 1 `CLUSTER'
		eststo  lib_3: reg tmp	fair 	if 				   		 leaning_num == 3 & black == 1 `CLUSTER'

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A5_2_1'", replace 
				 noobs nocons label compress nonotes
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 title("Table A5.2.1: The Discriminatee Race Effect and Justifiability Premium by Political Orientation: White Respondents Only")
				 mtitles(
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 ) 
				 collabels(none)
				 mgroups("Conservatives" "Moderates" "Liberals", 
						pattern(1 0 0  1 0 0  1 0 0 ))
				;
		#delim cr	
	restore
	
	
	* row 2: white
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if justifiability == 1 & leaning_num == 1 & black == 0
		eststo  con_2: mean 	fair 	if justifiability == 2 & leaning_num == 1 & black == 0
		eststo  mod_1: mean 	fair 	if justifiability == 1 & leaning_num == 2 & black == 0
		eststo  mod_2: mean 	fair 	if justifiability == 2 & leaning_num == 2 & black == 0
		eststo  lib_1: mean 	fair 	if justifiability == 1 & leaning_num == 3 & black == 0
		eststo  lib_2: mean 	fair 	if justifiability == 2 & leaning_num == 3 & black == 0
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "2. White Discriminatees"
		eststo  con_3: reg tmp	fair 	if 				   		 leaning_num == 1 & black == 0 `CLUSTER'
		eststo  mod_3: reg tmp	fair 	if 				   		 leaning_num == 2 & black == 0 `CLUSTER'
		eststo  lib_3: reg tmp	fair 	if 				   		 leaning_num == 3 & black == 0 `CLUSTER'

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A5_2_1'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
	restore
	
	* row 3: black - white
	estimates clear
	preserve
		lab var black "3. Gap (Black-White)"
		eststo  con_1: reg 	fair black	if justifiability == 1 & leaning_num == 1
		eststo  con_2: reg 	fair black	if justifiability == 2 & leaning_num == 1
		eststo  con_3: reg 	black
		
		eststo  mod_1: reg 	fair black	if justifiability == 1 & leaning_num == 2
		eststo  mod_2: reg 	fair black	if justifiability == 2 & leaning_num == 2
		eststo  mod_3: reg 	black
		
		eststo  lib_1: reg 	fair black	if justifiability == 1 & leaning_num == 3
		eststo  lib_2: reg 	fair black	if justifiability == 2 & leaning_num == 3
		eststo  lib_3: reg 	black

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A5_2_1'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
		
	restore	
	
	* row 4: all
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if justifiability == 1 & leaning_num == 1
		eststo  con_2: mean 	fair 	if justifiability == 2 & leaning_num == 1
		eststo  mod_1: mean 	fair 	if justifiability == 1 & leaning_num == 2
		eststo  mod_2: mean 	fair 	if justifiability == 2 & leaning_num == 2
		eststo  lib_1: mean 	fair 	if justifiability == 1 & leaning_num == 3
		eststo  lib_2: mean 	fair 	if justifiability == 2 & leaning_num == 3
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "4. All Discriminatees"
		eststo  con_3: reg tmp	fair 	if 				   		 leaning_num == 1 `CLUSTER'
		eststo  mod_3: reg tmp	fair 	if 				   		 leaning_num == 2 `CLUSTER'
		eststo  lib_3: reg tmp	fair 	if 				   		 leaning_num == 3 `CLUSTER'

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A5_2_1'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				 addnotes("*** p<0.01; ** p<0.05; * p<0.10.")  
				;
		#delim cr	
	restore
	

	** footnotes: equality of the discriminatee race effect (i.e., the Black treatment) between moderates and liberals
	reg fair black lib black_lib if lib == 1 |mod == 1 `CLUSTER'
	loc INT_PValues1: di %6.3f r(table)[4,3] // p = 0.386
	di "Footnote: A test for equality of the discriminatee race effect (i.e., the Black treatment) between moderate and liberal respondents yields p =`INT_PValues1'." 

	** footnotes: equality between conservatives and (moderates + liberals) 
	reg fair black lib2 black_lib2 `CLUSTER'
	loc INT_PValues2: di %6.3f r(table)[4,3] // p = 0.000
	di "Footnote: A test for equality of the discriminatee race effect between conservatives and (moderates + liberals) yields p =`INT_PValues2'."

	** footnotes: equality of the Less versus More Justifiability Gap across Conservatives, Moderates, and Liberals
	qui reg fair low_just if conserv == 1
		est store a
	qui reg fair low_just if mod == 1
		est store b
	qui reg fair low_just if lib == 1
		est store c 
	suest a b c `CLUSTER'
	test [a_mean]low_just = [b_mean]low_just = [c_mean]low_just
	loc EQUAL_PValues: di %6.3f `r(p)'  //p = 0.695
	di "Footnote: A test for equality of the Less versus More Justifiability Gap across Conservatives, Moderates, and Liberals yields p =`EQUAL_PValues'."
			

/* Table A5.2.2: The Discriminatee Race Effect by Political Orientation: White Respondents Only
------------------------------------------------------------------------------- */
use `DATA_REG', replace

	keep if race_white == 1
	keep if stage_one == 1
	assert stage_one == 1
	
	loc CLUSTER ", vce(cluster randomid)"
	
	* row 1: black
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if leaning_num == 1 & black == 1 `CLUSTER'
		eststo  mod_1: mean 	fair 	if leaning_num == 2 & black == 1 `CLUSTER'
		eststo  lib_1: mean 	fair 	if leaning_num == 3 & black == 1 `CLUSTER'
		 lab var fair "1. Black Discriminatees"

		#delim;
			esttab con_1 mod_1 lib_1 using "`TAB_A5_2_2'", replace 
				 noobs nocons label compress nonotes
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 stats(N, fmt(%7.0fc) labels("Num. obs."))
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 title("Table A5.2.2: The Discriminatee Race Effect by Political Orientation: White Respondents Only")
				 mtitles(
				 "All (Less and More Justifiable)"
				 "All (Less and More Justifiable)"
				 "All (Less and More Justifiable)"
				 ) 
				 collabels(none)
				 mgroups("Conservatives" "Moderates" "Liberals", 
						pattern(1 1 1))
				;
		#delim cr	
	restore
	
	
	* row 2: white
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if leaning_num == 1 & black == 0 `CLUSTER'
		eststo  mod_1: mean 	fair 	if leaning_num == 2 & black == 0 `CLUSTER'
		eststo  lib_1: mean 	fair 	if leaning_num == 3 & black == 0 `CLUSTER'
		 lab var fair "2. White Discriminatees"

		#delim;
			esttab con_1 mod_1 lib_1 using "`TAB_A5_2_2'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 stats(N, fmt(%7.0fc) labels("Num. obs."))
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
	restore
	
	* row 3: black - white
	estimates clear
	preserve
		lab var black "3. Gap (Black-White)"
		eststo  con_1: reg 	fair black	if leaning_num == 1 `CLUSTER'
		eststo  mod_1: reg 	fair black	if leaning_num == 2	`CLUSTER' 
		eststo  lib_1: reg 	fair black	if leaning_num == 3 `CLUSTER'

		#delim;
			esttab con_1 mod_1 lib_1 using "`TAB_A5_2_2'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 stats(N, fmt(%7.0fc) labels("Num. obs."))
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
		
	restore	
		
	
			

/* ******************************** Appendix 6 ******************************** */
			
/* Table A6.1: Summary of stated reasons why discrimination was "unfair" or "very unfair"
------------------------------------------------------------------------------- */			
/* and Table A6.2. Summary of stated reasons why discrimination was "fair" or "very fair"
------------------------------------------------------------------------------- */

	preserve
	
		clear
		* 1. import hand coded labels for open responses
		
		import delimited "`DTA_OR_LABELS'", numericcols(1) clear 
			isid randomid
			tempfile DTA_LABLES
			save `DTA_LABLES'

		* 2. merge with main dataset
		
		use "`DTA_MAIN'", replace
			keep if !mi(open_response)
			isid randomid

		merge 1:1 randomid using `DTA_LABLES'

		order open_response_label, after(open_response)

			* make sure every open_response of those (fair: very unfair = -3, unfair = -2, fair = 2, very fair = 3) is assigned a label
			assert _merge == 1 | _merge == 3
			assert _merge == 1 if (fair == -1 | fair == 0 | fair == 1)


		* check labels
		tab open_response_label if fair <= -2
		count if !mi(open_response_race) & fair <= -2  
			// count responses contained at least one word from the following list:
			// racist, racism, bigoted, discrimination, prejudice, bias, or stereotype.
		
		tab open_response_label if fair >= 2


		* 3. generate vars
		
		* (1) reasons - unfair, very unfair
		gen     unfair_very_reasons = .
		replace unfair_very_reasons = 1 if fair <= -2 & open_response_label == "wrong to use race"
		replace unfair_very_reasons = 2 if fair <= -2 & open_response_label == "poor info"
		replace unfair_very_reasons = 3 if fair <= -2 & open_response_label == "wrong to use tastes"

		lab var unfair_very_reasons "Classify stated reasons why discrimination was unfair or very unfair"
		lab def unfair_very_reasons 1 "Wrong to use race" ///
									2 "Wrong to use information" ///
									3 "Wrong to use tastes"
		lab val unfair_very_reasons unfair_very_reasons

		* (2) reasons - fair, very fair
		gen     fair_very_reasons = .
		replace fair_very_reasons = 1 if fair >= 2 & open_response_label == "business must thrive"
		replace fair_very_reasons = 2 if fair >= 2 & open_response_label == "employer rights"
		replace fair_very_reasons = 3 if fair >= 2 & open_response_label == "info quality"

		lab var fair_very_reasons "Classify stated reasons why discrimination was fair or very fair"
		lab def fair_very_reasons 1 "Business must thrive" ///
								  2 "Statements about employer rights" ///
								  3 "OK to raise profits using statistical information"
		lab val fair_very_reasons fair_very_reasons

		* (3) scenarios indicator
		gen     scenarios = .
		replace scenarios = 1 if taste == 0 
		replace scenarios = 0 if taste == 1 
		lab var scenarios "Scenarios"
		lab def scenarios 0 "Taste-Based Scenarios" 1 "Statistical Scenarios"
		lab val scenarios scenarios


		* 4. create tables

		** Table A6.1 
		estimates clear
		
		estpost tab unfair_very_reasons scenarios if fair <= -2
		
		#delim ;
			esttab . using "`TAB_A6_1'", replace
				cell(b) 
				unstack 
				noobs collabels(none) nomtitles nonumber
				;
		#delim cr
		
		
		** Table A6.1 

		estimates clear

		estpost tab fair_very_reasons scenarios if fair >= 2
		esttab ., label cell(b) ///
				unstack ///
				noobs collabels(none) nomtitles nonumber
		
		#delim ;
			esttab . using "`TAB_A6_2'", replace
				cell(b) 
				unstack 
				noobs collabels(none) nomtitles nonumber 
				varlabels(`e(labels)') 
				;
		#delim cr
		
	restore

			
			
/* ******************************** Appendix 8 ******************************** */ 

/* Table A8.1: Raw and Re-Weighted Sample composition, ACS weights
------------------------------------------------------------------------------- */
preserve

use `DATA_REG', replace

	keep if stage_one == 1

	estimates clear

	* (1) MTurk
	collapse (mean) male female race_white race_non_white age18_24 age25_44 age45_over education_hs_some_college education_college_or_above survey_weight, by(randomid)
	eststo mturk: estpost sum male female race_white race_non_white age18_24 age25_44 age45_over education_hs_some_college education_college_or_above

	* (2) Weighted sample
	eststo weighted: estpost sum male female race_white race_non_white age18_24 age25_44 age45_over education_hs_some_college education_college_or_above [iweight = survey_weight]
	
	* (3) ACS
	use "`DTA_ACS'", replace
	eststo acs: estpost sum male female race_white race_non_white age18_24 age25_44 age45_over education_hs_some_college education_college_or_above

	#delim ;
		esttab mturk weighted acs using "`TAB_A8_1'", replace 
			label legend
				   
			cells("mean(fmt(3))")
			
			coeflabels(
						male "Male" 
						female "Female" 
						race_white "White respondent" 
						race_non_white "Non-White respondent"
						age18_24 "Age 18-24" 
						age25_44 "Age 25-44" 
						age45_over "Age 45 and over"
						education_hs_some_college "HS or less, or 2-year/some college" 
						education_college_or_above "4-year college or graduate school"			
						)
			
			title("Table A8.1: Raw and Re-Weighted Sample Composition, ACS weights")

			mgroup("MTurk Sample" "Weighted Sample" "2019 ACS Sample", pattern(1 1 1))
			
			collabels(none)
			nomtitles
			
			stats(N, fmt(%10.0fc) labels("Observations"))
			
			addnotes(" " "Notes: Column 1 contains the percentage of respondents across various demographic characteristics within the MTurk sample. Column 3 contains these percentages for the 2019 American Community Survey (ACS) sample for comparison.")        
			
			;
	#delim cr
	
restore


/* Table A8.2: Replicates Table 1 with ACS Weights
------------------------------------------------------------------------------- */
use `DATA_REG', replace

	keep if stage_one == 1
	
	loc CLUSTER ", vce(cluster randomid)"
	loc WEIGHT  "[pweight = survey_weight]"

	* row 1: black
	estimates clear
	preserve
		eststo taste_1: mean 	fair 	if justifiability == 1 & taste == 1 & black == 1 `WEIGHT' `CLUSTER'
		eststo taste_2: mean 	fair 	if justifiability == 2 & taste == 1 & black == 1 `WEIGHT' `CLUSTER'
		eststo stats_1: mean 	fair 	if justifiability == 1 & taste == 0 & black == 1 `WEIGHT' `CLUSTER'
		eststo stats_2: mean 	fair 	if justifiability == 2 & taste == 0 & black == 1 `WEIGHT' `CLUSTER'
		eststo  comb_1: mean 	fair 	if justifiability == 1 				& black == 1 `WEIGHT' `CLUSTER'
		eststo  comb_2: mean 	fair 	if justifiability == 2 				& black == 1 `WEIGHT' `CLUSTER'
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "1. Black Discriminatees"
		eststo taste_3: reg tmp	fair 	if 				   		 taste == 1 & black == 1 `WEIGHT' `CLUSTER'
		eststo stats_3: reg tmp	fair 	if 				   		 taste == 0 & black == 1 `WEIGHT' `CLUSTER'
		eststo  comb_3: reg tmp	fair 	if 				   					  black == 1 `WEIGHT' `CLUSTER'

		#delim;
			esttab taste* stats* comb* using "`TAB_A8_2'", replace 
				 noobs nocons label compress nonotes
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
							b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 title("Table A8.2: Fairness Ratings by Treatment with ACS Weights")
				 mtitles(
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)" 
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)" 
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)") 
				 collabels(none)
				 mgroups("Taste-Based Discrimination" "Statistical Discrimination" "Taste and Statistical (combined)",              
						pattern(1 0 0 1 0 0 1 0 0))
				;
		#delim cr	
	restore
	
	
	* row 2: white
	estimates clear
	preserve
		eststo taste_1: mean 	fair 	if justifiability == 1 & taste == 1 & black == 0 `WEIGHT' `CLUSTER'
		eststo taste_2: mean 	fair 	if justifiability == 2 & taste == 1 & black == 0 `WEIGHT' `CLUSTER'	 
		eststo stats_1: mean 	fair 	if justifiability == 1 & taste == 0 & black == 0 `WEIGHT' `CLUSTER'
		eststo stats_2: mean 	fair 	if justifiability == 2 & taste == 0 & black == 0 `WEIGHT' `CLUSTER'	
		eststo  comb_1: mean 	fair 	if justifiability == 1 				& black == 0 `WEIGHT' `CLUSTER'
		eststo  comb_2: mean 	fair 	if justifiability == 2 				& black == 0 `WEIGHT' `CLUSTER'
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "2. White Discriminatees"
		eststo taste_3: reg tmp	fair 	if 				   		 taste == 1 & black == 0 `WEIGHT' `CLUSTER'
		eststo stats_3: reg tmp	fair 	if 				   		 taste == 0 & black == 0 `WEIGHT' `CLUSTER'
		eststo  comb_3: reg tmp	fair 	if 				   		 			  black == 0 `WEIGHT' `CLUSTER'
		
		#delim;
			esttab taste* stats* comb* using "`TAB_A8_2'", append 	 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						 b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
						 b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
	restore


	* row 3: black - white
	estimates clear
	preserve
		lab var black "3. Gap (Black-White)"
		eststo  taste_1: reg 	fair black	if justifiability == 1 & taste == 1 `WEIGHT' `CLUSTER'
		eststo  taste_2: reg 	fair black	if justifiability == 2 & taste == 1 `WEIGHT' `CLUSTER'
		eststo  taste_3: reg 	black
		
		eststo  stats_1: reg 	fair black	if justifiability == 1 & taste == 0 `WEIGHT' `CLUSTER'
		eststo  stats_2: reg 	fair black	if justifiability == 2 & taste == 0 `WEIGHT' `CLUSTER'
		eststo  stats_3: reg 	black
		
		eststo  comb_1: reg 	fair black	if justifiability == 1	            `WEIGHT' `CLUSTER'
		eststo  comb_2: reg 	fair black	if justifiability == 2	            `WEIGHT' `CLUSTER'	
		eststo  comb_3: reg 	black

		#delim;
			esttab taste* stats* comb* using "`TAB_A8_2'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						 b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
						 b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
		
	restore	
	
	* row 4: all
	estimates clear
	preserve
		eststo taste_1: mean	fair 	if justifiability == 1 & taste == 1 `WEIGHT' `CLUSTER'
		eststo taste_2: mean	fair 	if justifiability == 2 & taste == 1 `WEIGHT' `CLUSTER'	 
		eststo stats_1: mean	fair 	if justifiability == 1 & taste == 0 `WEIGHT' `CLUSTER'
		eststo stats_2: mean	fair 	if justifiability == 2 & taste == 0 `WEIGHT' `CLUSTER'	
		eststo  comb_1: mean	fair 	if justifiability == 1	            `WEIGHT' `CLUSTER'
		eststo  comb_2: mean	fair 	if justifiability == 2	            `WEIGHT' `CLUSTER'	
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		lab var fair "4. All Discriminatees"
		eststo taste_3: reg tmp	fair 	if 				   		 taste == 1 `WEIGHT' `CLUSTER'
		eststo stats_3: reg tmp	fair 	if 				   		 taste == 0 `WEIGHT' `CLUSTER'
		eststo  comb_3: reg tmp	fair 									    `WEIGHT' `CLUSTER'
		
		#delim;
			esttab taste* stats* comb*  using "`TAB_A8_2'", append 	 
				 noobs nocons label compress
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						 b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
						 b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 collabels(none)
				
				 addnotes("*** p<0.01; ** p<0.05; * p<0.10.")     
				;
		#delim cr	
	restore
	
	
	** footnotes
	reg fair black low_just black_low `WEIGHT' `CLUSTER'
	mat list r(table)
	loc INT_PValues: di %6.3f r(table)[4,3] // p =  0.140 (Difference in justifiability gap)
	di "Footnote: a test for equality of the Less versus More Justifiability Gap between the Black and White treatment yields p=`INT_PValues'."


/* Table A8.3: Replicates Table 2 with ACS Weights
------------------------------------------------------------------------------- */
use `DATA_REG', replace

	keep if stage_one == 1
	
	loc CLUSTER ", vce(cluster randomid)"
	loc WEIGHT  "[pweight = survey_weight]"

	* row 1: black
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if justifiability == 1 & leaning_num == 1 & black == 1 `WEIGHT'
		eststo  con_2: mean 	fair 	if justifiability == 2 & leaning_num == 1 & black == 1 `WEIGHT'
		eststo  mod_1: mean 	fair 	if justifiability == 1 & leaning_num == 2 & black == 1 `WEIGHT'
		eststo  mod_2: mean 	fair 	if justifiability == 2 & leaning_num == 2 & black == 1 `WEIGHT'
		eststo  lib_1: mean 	fair 	if justifiability == 1 & leaning_num == 3 & black == 1 `WEIGHT'
		eststo  lib_2: mean 	fair 	if justifiability == 2 & leaning_num == 3 & black == 1 `WEIGHT'
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "1. Black Discriminatees"
		eststo  con_3: reg tmp	fair 	if 				   		 leaning_num == 1 & black == 1 `WEIGHT' `CLUSTER'
		eststo  mod_3: reg tmp	fair 	if 				   		 leaning_num == 2 & black == 1 `WEIGHT' `CLUSTER'
		eststo  lib_3: reg tmp	fair 	if 				   		 leaning_num == 3 & black == 1 `WEIGHT' `CLUSTER'

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A8_3'", replace 
				 noobs nocons label compress nonotes
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 title("Table A8.3: The Discriminatee Race Effect and Justifiability Premium by Political Orientation with ACS Weights")
				 mtitles(
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 ) 
				 collabels(none)
				 mgroups("Conservatives" "Moderates" "Liberals", 
						pattern(1 0 0  1 0 0  1 0 0 ))
				;
		#delim cr	
	restore
	
	* row 2: white
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if justifiability == 1 & leaning_num == 1 & black == 0 `WEIGHT'
		eststo  con_2: mean 	fair 	if justifiability == 2 & leaning_num == 1 & black == 0 `WEIGHT'
		eststo  mod_1: mean 	fair 	if justifiability == 1 & leaning_num == 2 & black == 0 `WEIGHT'
		eststo  mod_2: mean 	fair 	if justifiability == 2 & leaning_num == 2 & black == 0 `WEIGHT'
		eststo  lib_1: mean 	fair 	if justifiability == 1 & leaning_num == 3 & black == 0 `WEIGHT'
		eststo  lib_2: mean 	fair 	if justifiability == 2 & leaning_num == 3 & black == 0 `WEIGHT'
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "2. White Discriminatees"
		eststo  con_3: reg tmp	fair 	if 				   		 leaning_num == 1 & black == 0 `WEIGHT' `CLUSTER'
		eststo  mod_3: reg tmp	fair 	if 				   		 leaning_num == 2 & black == 0 `WEIGHT' `CLUSTER'
		eststo  lib_3: reg tmp	fair 	if 				   		 leaning_num == 3 & black == 0 `WEIGHT' `CLUSTER'

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A8_3'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
	restore
	
	* row 3: black - white
	estimates clear
	preserve
		lab var black "3. Gap (Black-White)"
		eststo  con_1: reg 	fair black	if justifiability == 1 & leaning_num == 1 `WEIGHT'
		eststo  con_2: reg 	fair black	if justifiability == 2 & leaning_num == 1 `WEIGHT'
		eststo  con_3: reg 	black
		
		eststo  mod_1: reg 	fair black	if justifiability == 1 & leaning_num == 2 `WEIGHT'
		eststo  mod_2: reg 	fair black	if justifiability == 2 & leaning_num == 2 `WEIGHT'
		eststo  mod_3: reg 	black
		
		eststo  lib_1: reg 	fair black	if justifiability == 1 & leaning_num == 3 `WEIGHT'
		eststo  lib_2: reg 	fair black	if justifiability == 2 & leaning_num == 3 `WEIGHT'
		eststo  lib_3: reg 	black

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A8_3'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
		
	restore	
	

	* row 4: all
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if justifiability == 1 & leaning_num == 1 `WEIGHT' 
		eststo  con_2: mean 	fair 	if justifiability == 2 & leaning_num == 1 `WEIGHT' 
		eststo  mod_1: mean 	fair 	if justifiability == 1 & leaning_num == 2 `WEIGHT' 
		eststo  mod_2: mean 	fair 	if justifiability == 2 & leaning_num == 2 `WEIGHT' 
		eststo  lib_1: mean 	fair 	if justifiability == 1 & leaning_num == 3 `WEIGHT' 
		eststo  lib_2: mean 	fair 	if justifiability == 2 & leaning_num == 3 `WEIGHT' 
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "4. All Discriminatees"
		eststo  con_3: reg tmp	fair 	if 				   		 leaning_num == 1 `WEIGHT' `CLUSTER'
		eststo  mod_3: reg tmp	fair 	if 				   		 leaning_num == 2 `WEIGHT' `CLUSTER'
		eststo  lib_3: reg tmp	fair 	if 				   		 leaning_num == 3 `WEIGHT' `CLUSTER'

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A8_3'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				 addnotes("*** p<0.01; ** p<0.05; * p<0.10.")  
				;
		#delim cr	
	restore

	** footnotes: equality of the discriminatee race effect (i.e., the Black treatment) between moderates and liberals
	reg fair black lib black_lib if lib == 1 |mod == 1  `WEIGHT' `CLUSTER'
	loc INT_PValues1: di %6.3f r(table)[4,3] // p = 0.058
	di "Footnote: A test for equality of the discriminatee race effect (i.e., the Black treatment) between moderate and liberal respondents yields p =`INT_PValues1'." 

	** footnotes: equality between conservatives and (moderates + liberals) 
	reg fair black lib2 black_lib2  `WEIGHT' `CLUSTER'
	loc INT_PValues2: di %6.3f r(table)[4,3] // p = 0.006
	di "Footnote: A test for equality of the discriminatee race effect between conservatives and (moderates + liberals) yields p =`INT_PValues2'."

	** footnotes: equality of the Less versus More Justifiability Gap across Conservatives, Moderates, and Liberals
	loc IWEIGHT  "[iweight = survey_weight]"

	qui reg fair low_just if conserv == 1 `IWEIGHT' 
		est store a
	qui reg fair low_just if mod == 1 `IWEIGHT' 
		est store b
	qui reg fair low_just if lib == 1 `IWEIGHT' 
		est store c 
	suest a b c `CLUSTER'
	test [a_mean]low_just = [b_mean]low_just = [c_mean]low_just
	loc EQUAL_PValues: di %6.3f `r(p)'  //p = 0.153
	di "Footnote: A test for equality of the Less versus More Justifiability Gap across Conservatives, Moderates, and Liberals yields p =`EQUAL_PValues'."
	

/* Table A8.4: Replicates Table 3 with ACS Weights
-------------------------------------------------------------------------------	*/
use `DATA_REG', replace

	keep if stage_one == 1
	
	loc CLUSTER ", vce(cluster randomid)"
	loc WEIGHT  "[pweight = survey_weight]"

	estimates clear
	
	preserve
		lab var bro "BRO"
		eststo bro1: mean bro if leaning_num == 1 `WEIGHT' `CLUSTER'
		eststo bro2: mean bro if leaning_num == 2 `WEIGHT' `CLUSTER'
		eststo bro3: mean bro if leaning_num == 3 `WEIGHT' `CLUSTER'


		** footnotes: equality of the Less versus More Justifiability Gap across Conservatives, Moderates, and Liberals
		reg bro conserv if lib == 0 `WEGITH' `CLUSTER'
		loc P_CON_MOD: di %6.3f r(table)[4,1] // p = 0.000
		
		reg bro mod  if conserv == 0 `WEGITH' `CLUSTER'
		loc P_MOD_LIB: di %6.3f r(table)[4,1] // p = 0.001

		reg bro lib if mod == 0 `WEGITH' `CLUSTER'
		loc P_LIB_CON: di %6.3f r(table)[4,1] // p = 0.00

		loc IWEIGHT  "[iweight = survey_weight]"

		qui reg bro conserv if lib == 0 `IWEIGHT'
			est store a
		qui reg bro mod if conserv == 0 `IWEIGHT'
			est store b
		qui reg bro lib if mod == 0 `IWEIGHT'
			est store c
		suest a b c `CLUSTER'
		test [a_lnvar]_cons = [b_lnvar]_cons = [c_lnvar]_cons
		loc P_THREE: di %6.3f `r(p)'	// p = .010
	
	
		#delim;
			esttab bro* using "`TAB_A8_4'", replace 
				 nocons label compress nonotes
				 stats(N, fmt(%7.0fc) labels("Num. obs."))
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						  b(fmt(3) pattern(1 1 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 1) par)
					   "
					  )
				 title("Table A8.4: Respondents' Perception of Black People's Relative Economic Opportunities (BRO) by Political Leaning with ACS Weights")
				 mtitles("Conservatives" "Moderates" "Liberals")
				 collabels(none)
				 mgroups("Political Leaning",              
						pattern(1 0 0))
				 addnotes(" " 
				 "*** p<0.01; ** p<0.05; * p<0.10."
				 "Notes: BRO is the respondent's assessment of Black peoples' relative economic opportunity on a scale of -3 (much less) to 3 (much more). Results are based on Stage 1 observations only. p-values are clustered by respondent." ""
				 "p-values for tests of equality are:"
				 "    Conservatives vs. Moderates: p=`P_CON_MOD';"
				 "    Moderates vs. Liberals: p=`P_MOD_LIB';"
				 "    Liberals vs. Conservatives: p=`P_LIB_CON';"
				 "    Across all three political groups: p=`P_THREE'."
				 )  
				;
		#delim cr	
	restore 

	
/* ******************************** Appendix 9 ******************************** */



/* Table A9.1: Raw and Re-Weighted Sample Composition, GSS weights
------------------------------------------------------------------------------- */
use `DATA_REG', replace

	keep if stage_one == 1

preserve

	estimates clear

	* (1) MTurk
	collapse (mean) extremely_conservative conservative slightly_conservative moderate slightly_liberal liberal extremely_liberal survey_weight2, by (randomid)
	eststo mturk: estpost sum extremely_conservative conservative slightly_conservative moderate slightly_liberal liberal extremely_liberal

	* (2) Weighted sample
	eststo weighted: estpost sum extremely_conservative conservative slightly_conservative moderate slightly_liberal liberal extremely_liberal [iweight = survey_weight2]
	
	* (3) GSS
	use "`DTA_GSS'", replace
	eststo gss: estpost sum extremely_conservative conservative slightly_conservative moderate slightly_liberal liberal extremely_liberal
	

	#delim ;
		esttab mturk weighted gss using "`TAB_A9_1'", replace 
			label legend
				   
			cells("mean(fmt(3))")
			
			coeflabels(
					   extremely_conservative "Extremely conservative"
					   conservative "Conservative"
					   slightly_conservative "Slightly conservative"
					   moderate "Moderate"
					   slightly_liberal "Slightly liberal"
					   liberal "Liberal"
					   extremely_liberal "Extremely liberal"
					  )
			
			title("Table A9.1: Raw and Re-Weighted Sample Composition, GSS weights")

			mgroups("MTurk Sample" "Weighted Sample" "2020 GSS Sample", pattern(1 1 1))
			
			collabels(none)
			nomtitles
			
			stats(N, fmt(%10.0fc) labels("Observations"))
			
			addnotes(" " "Column 1 contains the percentage of respondents by political leaning within the MTurk sample. Column 3 contains that of the 2020 GSS. Our political party preference question is not comparable to the GSS.")        
			
			;
	#delim cr
restore


/* Table A9.2: Replicates Table 1 with GSS Weights
------------------------------------------------------------------------------- */
use `DATA_REG', replace

	keep if stage_one == 1
	
	loc CLUSTER ", vce(cluster randomid)"
	loc WEIGHT  "[pweight = survey_weight2]"

	* row 1: black
	estimates clear
	preserve
		eststo taste_1: mean 	fair 	if justifiability == 1 & taste == 1 & black == 1 `WEIGHT' `CLUSTER'
		eststo taste_2: mean 	fair 	if justifiability == 2 & taste == 1 & black == 1 `WEIGHT' `CLUSTER'
		eststo stats_1: mean 	fair 	if justifiability == 1 & taste == 0 & black == 1 `WEIGHT' `CLUSTER'
		eststo stats_2: mean 	fair 	if justifiability == 2 & taste == 0 & black == 1 `WEIGHT' `CLUSTER'
		eststo  comb_1: mean 	fair 	if justifiability == 1 				& black == 1 `WEIGHT' `CLUSTER'
		eststo  comb_2: mean 	fair 	if justifiability == 2 				& black == 1 `WEIGHT' `CLUSTER'
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "1. Black Discriminatees"
		eststo taste_3: reg tmp	fair 	if 				   		 taste == 1 & black == 1 `WEIGHT' `CLUSTER'
		eststo stats_3: reg tmp	fair 	if 				   		 taste == 0 & black == 1 `WEIGHT' `CLUSTER'
		eststo  comb_3: reg tmp	fair 	if 				   					  black == 1 `WEIGHT' `CLUSTER'

		#delim;
			esttab taste* stats* comb* using "`TAB_A9_2'", replace 
				 noobs nocons label compress nonotes
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
							b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 title("Table A9.2: Fairness Ratings by Treatment with GSS Weights")
				 mtitles(
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)" 
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)" 
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)") 
				 collabels(none)
				 mgroups("Taste-Based Discrimination" "Statistical Discrimination" "Taste and Statistical (combined)",              
						pattern(1 0 0 1 0 0 1 0 0))
				;
		#delim cr	
	restore
	
	
	* row 2: white
	estimates clear
	preserve
		eststo taste_1: mean 	fair 	if justifiability == 1 & taste == 1 & black == 0 `WEIGHT' `CLUSTER'
		eststo taste_2: mean 	fair 	if justifiability == 2 & taste == 1 & black == 0 `WEIGHT' `CLUSTER'	 
		eststo stats_1: mean 	fair 	if justifiability == 1 & taste == 0 & black == 0 `WEIGHT' `CLUSTER'
		eststo stats_2: mean 	fair 	if justifiability == 2 & taste == 0 & black == 0 `WEIGHT' `CLUSTER'	
		eststo  comb_1: mean 	fair 	if justifiability == 1 				& black == 0 `WEIGHT' `CLUSTER'
		eststo  comb_2: mean 	fair 	if justifiability == 2 				& black == 0 `WEIGHT' `CLUSTER'
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "2. White Discriminatees"
		eststo taste_3: reg tmp	fair 	if 				   		 taste == 1 & black == 0 `WEIGHT' `CLUSTER'
		eststo stats_3: reg tmp	fair 	if 				   		 taste == 0 & black == 0 `WEIGHT' `CLUSTER'
		eststo  comb_3: reg tmp	fair 	if 				   		 			  black == 0 `WEIGHT' `CLUSTER'
		
		#delim;
			esttab taste* stats* comb* using "`TAB_A9_2'", append 	 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						 b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
						 b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
	restore

	* row 3: black - white
	estimates clear
	preserve
		lab var black "3. Gap (Black-White)"
		eststo  taste_1: reg 	fair black	if justifiability == 1 & taste == 1 `WEIGHT' `CLUSTER'
		eststo  taste_2: reg 	fair black	if justifiability == 2 & taste == 1 `WEIGHT' `CLUSTER'
		eststo  taste_3: reg 	black
		
		eststo  stats_1: reg 	fair black	if justifiability == 1 & taste == 0 `WEIGHT' `CLUSTER'
		eststo  stats_2: reg 	fair black	if justifiability == 2 & taste == 0 `WEIGHT' `CLUSTER'
		eststo  stats_3: reg 	black
		
		eststo  comb_1: reg 	fair black	if justifiability == 1	            `WEIGHT' `CLUSTER'
		eststo  comb_2: reg 	fair black	if justifiability == 2	            `WEIGHT' `CLUSTER'	
		eststo  comb_3: reg 	black

		#delim;
			esttab taste* stats* comb* using "`TAB_A9_2'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						 b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
						 b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
		
	restore	
	
	* row 4: all
	estimates clear
	preserve
		eststo taste_1: mean	fair 	if justifiability == 1 & taste == 1 `WEIGHT' `CLUSTER'
		eststo taste_2: mean	fair 	if justifiability == 2 & taste == 1 `WEIGHT' `CLUSTER'	 
		eststo stats_1: mean	fair 	if justifiability == 1 & taste == 0 `WEIGHT' `CLUSTER'
		eststo stats_2: mean	fair 	if justifiability == 2 & taste == 0 `WEIGHT' `CLUSTER'	
		eststo  comb_1: mean	fair 	if justifiability == 1	            `WEIGHT' `CLUSTER'
		eststo  comb_2: mean	fair 	if justifiability == 2	            `WEIGHT' `CLUSTER'	
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		lab var fair "4. All Discriminatees"
		eststo taste_3: reg tmp	fair 	if 				   		 taste == 1 `WEIGHT' `CLUSTER'
		eststo stats_3: reg tmp	fair 	if 				   		 taste == 0 `WEIGHT' `CLUSTER'
		eststo  comb_3: reg tmp	fair 									    `WEIGHT' `CLUSTER'
		
		#delim;
			esttab taste* stats* comb*  using "`TAB_A9_2'", append 	 
				 noobs nocons label compress
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						 b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
						 b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 collabels(none)
				
				 addnotes("*** p<0.01; ** p<0.05; * p<0.10.")     
				;
		#delim cr	
	restore

	
	** footnotes
	reg fair black low_just black_low `WEIGHT' `CLUSTER'
	mat list r(table)
	loc INT_PValues: di %6.3f r(table)[4,3] // p =  0.744 (Difference in justifiability gap)
	di "Footnote: a test for equality of the Less versus More Justifiability Gap between the Black and White treatment yields p=`INT_PValues'."


/* Table A9.3: Replicates Table 2 with GSS Weights
------------------------------------------------------------------------------- */
use `DATA_REG', replace

	keep if stage_one == 1
	
	loc CLUSTER ", vce(cluster randomid)"
	loc WEIGHT  "[pweight = survey_weight2]"

	* row 1: black
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if justifiability == 1 & leaning_num == 1 & black == 1 `WEIGHT'
		eststo  con_2: mean 	fair 	if justifiability == 2 & leaning_num == 1 & black == 1 `WEIGHT'
		eststo  mod_1: mean 	fair 	if justifiability == 1 & leaning_num == 2 & black == 1 `WEIGHT'
		eststo  mod_2: mean 	fair 	if justifiability == 2 & leaning_num == 2 & black == 1 `WEIGHT'
		eststo  lib_1: mean 	fair 	if justifiability == 1 & leaning_num == 3 & black == 1 `WEIGHT'
		eststo  lib_2: mean 	fair 	if justifiability == 2 & leaning_num == 3 & black == 1 `WEIGHT'
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "1. Black Discriminatees"
		eststo  con_3: reg tmp	fair 	if 				   		 leaning_num == 1 & black == 1 `WEIGHT' `CLUSTER'
		eststo  mod_3: reg tmp	fair 	if 				   		 leaning_num == 2 & black == 1 `WEIGHT' `CLUSTER'
		eststo  lib_3: reg tmp	fair 	if 				   		 leaning_num == 3 & black == 1 `WEIGHT' `CLUSTER'

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A9_3'", replace 
				 noobs nocons label compress nonotes
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 title("Table A9.3: The Discriminatee Race Effect and Justifiability Premium by Political Orientation with GSS Weights")
				 mtitles(
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 ) 
				 collabels(none)
				 mgroups("Conservatives" "Moderates" "Liberals", 
						pattern(1 0 0  1 0 0  1 0 0 ))
				;
		#delim cr	
	restore
	
	* row 2: white
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if justifiability == 1 & leaning_num == 1 & black == 0 `WEIGHT'
		eststo  con_2: mean 	fair 	if justifiability == 2 & leaning_num == 1 & black == 0 `WEIGHT'
		eststo  mod_1: mean 	fair 	if justifiability == 1 & leaning_num == 2 & black == 0 `WEIGHT'
		eststo  mod_2: mean 	fair 	if justifiability == 2 & leaning_num == 2 & black == 0 `WEIGHT'
		eststo  lib_1: mean 	fair 	if justifiability == 1 & leaning_num == 3 & black == 0 `WEIGHT'
		eststo  lib_2: mean 	fair 	if justifiability == 2 & leaning_num == 3 & black == 0 `WEIGHT'
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "2. White Discriminatees"
		eststo  con_3: reg tmp	fair 	if 				   		 leaning_num == 1 & black == 0 `WEIGHT' `CLUSTER'
		eststo  mod_3: reg tmp	fair 	if 				   		 leaning_num == 2 & black == 0 `WEIGHT' `CLUSTER'
		eststo  lib_3: reg tmp	fair 	if 				   		 leaning_num == 3 & black == 0 `WEIGHT' `CLUSTER'

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A9_3'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
	restore
	
	* row 3: black - white
	estimates clear
	preserve
		lab var black "3. Gap (Black-White)"
		eststo  con_1: reg 	fair black	if justifiability == 1 & leaning_num == 1 `WEIGHT'
		eststo  con_2: reg 	fair black	if justifiability == 2 & leaning_num == 1 `WEIGHT'
		eststo  con_3: reg 	black
		
		eststo  mod_1: reg 	fair black	if justifiability == 1 & leaning_num == 2 `WEIGHT'
		eststo  mod_2: reg 	fair black	if justifiability == 2 & leaning_num == 2 `WEIGHT'
		eststo  mod_3: reg 	black
		
		eststo  lib_1: reg 	fair black	if justifiability == 1 & leaning_num == 3 `WEIGHT'
		eststo  lib_2: reg 	fair black	if justifiability == 2 & leaning_num == 3 `WEIGHT'
		eststo  lib_3: reg 	black

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A9_3'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
		
	restore	
	

	* row 4: all
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if justifiability == 1 & leaning_num == 1 `WEIGHT' 
		eststo  con_2: mean 	fair 	if justifiability == 2 & leaning_num == 1 `WEIGHT' 
		eststo  mod_1: mean 	fair 	if justifiability == 1 & leaning_num == 2 `WEIGHT' 
		eststo  mod_2: mean 	fair 	if justifiability == 2 & leaning_num == 2 `WEIGHT' 
		eststo  lib_1: mean 	fair 	if justifiability == 1 & leaning_num == 3 `WEIGHT' 
		eststo  lib_2: mean 	fair 	if justifiability == 2 & leaning_num == 3 `WEIGHT' 
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "4. All Discriminatees"
		eststo  con_3: reg tmp	fair 	if 				   		 leaning_num == 1 `WEIGHT' `CLUSTER'
		eststo  mod_3: reg tmp	fair 	if 				   		 leaning_num == 2 `WEIGHT' `CLUSTER'
		eststo  lib_3: reg tmp	fair 	if 				   		 leaning_num == 3 `WEIGHT' `CLUSTER'

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A9_3'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				 addnotes("*** p<0.01; ** p<0.05; * p<0.10.")  
				;
		#delim cr	
	restore

	** footnotes: equality of the discriminatee race effect (i.e., the Black treatment) between moderates and liberals
	reg fair black lib black_lib if lib == 1 |mod == 1  `WEIGHT' `CLUSTER'
	loc INT_PValues1: di %6.3f r(table)[4,3] // p = 0.628
	di "Footnote: A test for equality of the discriminatee race effect (i.e., the Black treatment) between moderate and liberal respondents yields p =`INT_PValues1'." 

	** footnotes: equality between conservatives and (moderates + liberals) 
	reg fair black lib2 black_lib2  `WEIGHT' `CLUSTER'
	loc INT_PValues2: di %6.3f r(table)[4,3] // p = 0.001
	di "Footnote: A test for equality of the discriminatee race effect between conservatives and (moderates + liberals) yields p =`INT_PValues2'."

	** footnotes: equality of the Less versus More Justifiability Gap across Conservatives, Moderates, and Liberals
	loc IWEIGHT  "[iweight = survey_weight2]"

	qui reg fair low_just if conserv == 1 `IWEIGHT' 
		est store a
	qui reg fair low_just if mod == 1 `IWEIGHT' 
		est store b
	qui reg fair low_just if lib == 1 `IWEIGHT' 
		est store c 
	suest a b c `CLUSTER'
	test [a_mean]low_just = [b_mean]low_just = [c_mean]low_just
	loc EQUAL_PValues: di %6.3f `r(p)'  //p = 0.541
	di "Footnote: A test for equality of the Less versus More Justifiability Gap across Conservatives, Moderates, and Liberals yields p =`EQUAL_PValues'."
	

/* Table A9.4: Replicates Table 3 with GSS Weights
-------------------------------------------------------------------------------	*/
use `DATA_REG', replace

	keep if stage_one == 1
	
	loc CLUSTER ", vce(cluster randomid)"
	loc WEIGHT  "[pweight = survey_weight2]"

	estimates clear
	
	preserve
		lab var bro "BRO"
		eststo bro1: mean bro if leaning_num == 1 `WEIGHT' `CLUSTER'
		eststo bro2: mean bro if leaning_num == 2 `WEIGHT' `CLUSTER'
		eststo bro3: mean bro if leaning_num == 3 `WEIGHT' `CLUSTER'


		** footnotes: equality of the Less versus More Justifiability Gap across Conservatives, Moderates, and Liberals
		reg bro conserv if lib == 0 `WEGITH' `CLUSTER'
		loc P_CON_MOD: di %6.3f r(table)[4,1] // p = 0.000
		
		reg bro mod  if conserv == 0 `WEGITH' `CLUSTER'
		loc P_MOD_LIB: di %6.3f r(table)[4,1] // p = 0.001

		reg bro lib if mod == 0 `WEGITH' `CLUSTER'
		loc P_LIB_CON: di %6.3f r(table)[4,1] // p = 0.000
		

		loc IWEIGHT  "[iweight = survey_weight2]"

		qui reg bro conserv if lib == 0 `IWEIGHT'
			est store a
		qui reg bro mod if conserv == 0 `IWEIGHT'
			est store b
		qui reg bro lib if mod == 0 `IWEIGHT'
			est store c
		suest a b c `CLUSTER'
		test [a_lnvar]_cons = [b_lnvar]_cons = [c_lnvar]_cons
		loc P_THREE: di %6.3f `r(p)'	// p = .503
	
	
		#delim;
			esttab bro* using "`TAB_A9_4'", replace 
				 nocons label compress nonotes
				 stats(N, fmt(%7.0fc) labels("Num. obs."))
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						  b(fmt(3) pattern(1 1 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 1) par)
					   "
					  )
				 title("Table A9.4: Respondents' Perception of Black People's Relative Economic Opportunities (BRO) by Political Leaning with GSS Weights")
				 mtitles("Conservatives" "Moderates" "Liberals")
				 collabels(none)
				 mgroups("Political Leaning",              
						pattern(1 0 0))
				 addnotes(" " 
				 "*** p<0.01; ** p<0.05; * p<0.10."
				 "Notes: BRO is the respondent's assessment of Black peoples' relative economic opportunity on a scale of -3 (much less) to 3 (much more). Results are based on Stage 1 observations only. p-values are clustered by respondent." ""
				 "p-values for tests of equality are:"
				 "    Conservatives vs. Moderates: p=`P_CON_MOD';"
				 "    Moderates vs. Liberals: p=`P_MOD_LIB';"
				 "    Liberals vs. Conservatives: p=`P_LIB_CON';"
				 "    Across all three political groups: p=`P_THREE'."
				 )  
				;
		#delim cr	
	restore 

	

/* ******************************** Appendix 10 ******************************** */


/* Table A10.1: Composition of MTurk Sample versus "Thoughtful" Subsample
------------------------------------------------------------------------------- */
use `DATA_REG', replace
	
estimates clear

	preserve
		
		* (1) Full
		collapse (mean) male female race_white race_black race_asian race_hispanic race_indigenous race_islander race_other age18_24 age25_34 age35_44 age45_54 age55_64 age65_over education_hs education_some_college education_four_college education_higher thoughtful, by (randomid)

		eststo full: estpost sum male female race_white race_black race_asian race_hispanic race_indigenous race_islander race_other age18_24 age25_34 age35_44 age45_54 age55_64 age65_over education_hs education_some_college education_four_college education_higher 
		
		* (2) Thoughtful
		eststo thoughtful: estpost sum male female race_white race_black race_asian race_hispanic race_indigenous race_islander race_other age18_24 age25_34 age35_44 age45_54 age55_64 age65_over education_hs education_some_college education_four_college education_higher if thoughtful == 1
		
	restore	

	
	#delim ;
		esttab full thoughtful using "`TAB_A10_1'", replace 
			label legend
				   
			cells("mean(fmt(3))")
			
			coeflabels(
						male "Male" 
						female "Female" 
						race_white "White respondent" 
						race_black "Black respondent" 
						race_asian "Asian respondent" 
						race_hispanic "Hispanic respondent" 
						race_indigenous "American Indigenous respondent" 
						race_islander "Pacific Islander respondent" 
						race_other "Other race respondent"
						age18_24 "Age 18-24" 
						age25_34 "Age 25-34"  
						age35_44 "Age 35-44" 
						age45_54 "Age 45-54" 
						age55_64 "Age 55-64"  
						age65_over "Age 65 and over"
						education_hs "High School or less" 
						education_some_college "2-year or some college" 
						education_four_college "4-year college or university"  
						education_higher "Higher degree"			
						)
			
			title("Table A10.1: Composition of MTurk Sample versus 'Thoughtful' Subsample")

			mgroups("Full Sample" `""Thoughtful" Sub-sample"', pattern(1 1))
			
			collabels(none) 
			nomtitles
			
			;
	#delim cr
	

/* Table A10.2: Replicates Table 1 for 'Thoughtful' Subjects Only
------------------------------------------------------------------------------- */
use `DATA_REG', replace

	keep if stage_one == 1
	
	keep if thoughtful == 1

	loc CLUSTER ", vce(cluster randomid)"
	
	* row 1: black
	estimates clear
	preserve
		eststo taste_1: mean 	fair 	if justifiability == 1 & taste == 1 & black == 1 `CLUSTER'
		eststo taste_2: mean 	fair 	if justifiability == 2 & taste == 1 & black == 1 `CLUSTER'
		eststo stats_1: mean 	fair 	if justifiability == 1 & taste == 0 & black == 1 `CLUSTER'
		eststo stats_2: mean 	fair 	if justifiability == 2 & taste == 0 & black == 1 `CLUSTER'
		eststo  comb_1: mean 	fair 	if justifiability == 1 				& black == 1 `CLUSTER'
		eststo  comb_2: mean 	fair 	if justifiability == 2 				& black == 1 `CLUSTER'
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "1. Black Discriminatees"
		eststo taste_3: reg tmp	fair 	if 				   		 taste == 1 & black == 1 `CLUSTER'
		eststo stats_3: reg tmp	fair 	if 				   		 taste == 0 & black == 1 `CLUSTER'
		eststo  comb_3: reg tmp	fair 	if 				   					  black == 1 `CLUSTER'

		#delim;
			esttab taste* stats* comb* using "`TAB_A10_2'", replace 
				 noobs nocons label compress nonotes
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
							b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 title("Table A10.2: Fairness Ratings by Treatment: 'Thoughtful' Subjects Only")
				 mtitles(
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)" 
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)" 
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)") 
				 collabels(none)
				 mgroups("Taste-Based Discrimination" "Statistical Discrimination" "Taste and Statistical (combined)",              
						pattern(1 0 0 1 0 0 1 0 0))
				;
		#delim cr	
	restore
	
	
	* row 2: white
	estimates clear
	preserve
		eststo taste_1: mean 	fair 	if justifiability == 1 & taste == 1 & black == 0 `CLUSTER'
		eststo taste_2: mean 	fair 	if justifiability == 2 & taste == 1 & black == 0 `CLUSTER'	 
		eststo stats_1: mean 	fair 	if justifiability == 1 & taste == 0 & black == 0 `CLUSTER'
		eststo stats_2: mean 	fair 	if justifiability == 2 & taste == 0 & black == 0 `CLUSTER'	
		eststo  comb_1: mean 	fair 	if justifiability == 1 				& black == 0 `CLUSTER'
		eststo  comb_2: mean 	fair 	if justifiability == 2 				& black == 0 `CLUSTER'
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "2. White Discriminatees"
		eststo taste_3: reg tmp	fair 	if 				   		 taste == 1 & black == 0 `CLUSTER'
		eststo stats_3: reg tmp	fair 	if 				   		 taste == 0 & black == 0 `CLUSTER'
		eststo  comb_3: reg tmp	fair 	if 				   		 			  black == 0 `CLUSTER'
		
		#delim;
			esttab taste* stats* comb* using "`TAB_A10_2'", append 	 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						 b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
						 b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
	restore


	* row 3: black - white
	estimates clear
	preserve
		lab var black "3. Gap (Black-White)"
		eststo  taste_1: reg 	fair black	if justifiability == 1 & taste == 1 `CLUSTER'
		eststo  taste_2: reg 	fair black	if justifiability == 2 & taste == 1 `CLUSTER'
		eststo  taste_3: reg 	black
		
		eststo  stats_1: reg 	fair black	if justifiability == 1 & taste == 0 `CLUSTER'
		eststo  stats_2: reg 	fair black	if justifiability == 2 & taste == 0 `CLUSTER'
		eststo  stats_3: reg 	black
		
		eststo  comb_1: reg 	fair black	if justifiability == 1	            `CLUSTER'
		eststo  comb_2: reg 	fair black	if justifiability == 2	            `CLUSTER'	
		eststo  comb_3: reg 	black

		#delim;
			esttab taste* stats* comb* using "`TAB_A10_2'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						 b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
						 b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
		
	restore	
	
	* row 4: all
	estimates clear
	preserve
		eststo taste_1: mean	fair 	if justifiability == 1 & taste == 1 `CLUSTER'
		eststo taste_2: mean	fair 	if justifiability == 2 & taste == 1 `CLUSTER'	 
		eststo stats_1: mean	fair 	if justifiability == 1 & taste == 0 `CLUSTER'
		eststo stats_2: mean	fair 	if justifiability == 2 & taste == 0 `CLUSTER'	
		eststo  comb_1: mean	fair 	if justifiability == 1	            `CLUSTER'
		eststo  comb_2: mean	fair 	if justifiability == 2	            `CLUSTER'	
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		lab var fair "4. All Discriminatees"
		eststo taste_3: reg tmp	fair 	if 				   		 taste == 1 `CLUSTER'
		eststo stats_3: reg tmp	fair 	if 				   		 taste == 0 `CLUSTER'
		eststo  comb_3: reg tmp	fair 									    `CLUSTER'
		
		#delim;
			esttab taste* stats* comb*  using "`TAB_A10_2'", append 	 
				 noobs nocons label compress
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						 b(fmt(3) pattern(1 1 0 1 1 0 1 1 0) star)
						 b(fmt(3) pattern(0 0 1 0 0 1 0 0 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0 1 1 0 1 1 0) par)
						 se(fmt(3) pattern(0 0 1 0 0 1 0 0 1) par)
					   "
					  )
				 collabels(none)
				
				 addnotes("*** p<0.01; ** p<0.05; * p<0.10.")     
				;
		#delim cr	
	restore
	
	** footnotes
	reg fair black low_just black_low `CLUSTER'
	mat list r(table)
	loc INT_PValues: di %6.3f r(table)[4,3] // p = 0.845 (Difference in justifiability gap)
	di "Footnote: a test for equality of the Less versus More Justifiability Gap between the Black and White treatment yields p=`INT_PValues'."
	
	
/* Table A10.3: Replicates Table 2 for 'Thoughtful' Subjects Only
------------------------------------------------------------------------------- */
use `DATA_REG', replace
	
	keep if stage_one == 1

	keep if thoughtful == 1

	loc CLUSTER ", vce(cluster randomid)"

	* row 1: black
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if justifiability == 1 & leaning_num == 1 & black == 1
		eststo  con_2: mean 	fair 	if justifiability == 2 & leaning_num == 1 & black == 1
		eststo  mod_1: mean 	fair 	if justifiability == 1 & leaning_num == 2 & black == 1
		eststo  mod_2: mean 	fair 	if justifiability == 2 & leaning_num == 2 & black == 1
		eststo  lib_1: mean 	fair 	if justifiability == 1 & leaning_num == 3 & black == 1
		eststo  lib_2: mean 	fair 	if justifiability == 2 & leaning_num == 3 & black == 1
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "1. Black Discriminatees"
		eststo  con_3: reg tmp	fair 	if 				   		 leaning_num == 1 & black == 1 `CLUSTER'
		eststo  mod_3: reg tmp	fair 	if 				   		 leaning_num == 2 & black == 1 `CLUSTER'
		eststo  lib_3: reg tmp	fair 	if 				   		 leaning_num == 3 & black == 1 `CLUSTER'

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A10_3'", replace 
				 noobs nocons label compress nonotes
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 title("Table A10.3: The Discriminatee Race Effect and Justifiability Premium by Political Orientation: 'Thoughtful' Subjects Only")
				 mtitles(
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 "Less Justifiable" "More Justifiable" "Gap{\line}(More - Less)"
				 ) 
				 collabels(none)
				 mgroups("Conservatives" "Moderates" "Liberals", 
						pattern(1 0 0  1 0 0  1 0 0 ))
				;
		#delim cr	
	restore
	
	* row 2: white
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if justifiability == 1 & leaning_num == 1 & black == 0
		eststo  con_2: mean 	fair 	if justifiability == 2 & leaning_num == 1 & black == 0
		eststo  mod_1: mean 	fair 	if justifiability == 1 & leaning_num == 2 & black == 0
		eststo  mod_2: mean 	fair 	if justifiability == 2 & leaning_num == 2 & black == 0
		eststo  lib_1: mean 	fair 	if justifiability == 1 & leaning_num == 3 & black == 0
		eststo  lib_2: mean 	fair 	if justifiability == 2 & leaning_num == 3 & black == 0
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "2. White Discriminatees"
		eststo  con_3: reg tmp	fair 	if 				   		 leaning_num == 1 & black == 0 `CLUSTER'
		eststo  mod_3: reg tmp	fair 	if 				   		 leaning_num == 2 & black == 0 `CLUSTER'
		eststo  lib_3: reg tmp	fair 	if 				   		 leaning_num == 3 & black == 0 `CLUSTER'

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A10_3'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
	restore
	
	* row 3: black - white
	estimates clear
	preserve
		lab var black "3. Gap (Black-White)"
		eststo  con_1: reg 	fair black	if justifiability == 1 & leaning_num == 1
		eststo  con_2: reg 	fair black	if justifiability == 2 & leaning_num == 1
		eststo  con_3: reg 	black
		
		eststo  mod_1: reg 	fair black	if justifiability == 1 & leaning_num == 2
		eststo  mod_2: reg 	fair black	if justifiability == 2 & leaning_num == 2
		eststo  mod_3: reg 	black
		
		eststo  lib_1: reg 	fair black	if justifiability == 1 & leaning_num == 3
		eststo  lib_2: reg 	fair black	if justifiability == 2 & leaning_num == 3
		eststo  lib_3: reg 	black

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A10_3'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				;
		#delim cr	
		
	restore	
	

	* row 4: all
	estimates clear
	preserve
		eststo  con_1: mean 	fair 	if justifiability == 1 & leaning_num == 1
		eststo  con_2: mean 	fair 	if justifiability == 2 & leaning_num == 1
		eststo  mod_1: mean 	fair 	if justifiability == 1 & leaning_num == 2
		eststo  mod_2: mean 	fair 	if justifiability == 2 & leaning_num == 2
		eststo  lib_1: mean 	fair 	if justifiability == 1 & leaning_num == 3
		eststo  lib_2: mean 	fair 	if justifiability == 2 & leaning_num == 3
		// exchange names for table output
		 rename fair tmp
		 rename justifiability fair
		 lab var fair "4. All Discriminatees"
		eststo  con_3: reg tmp	fair 	if 				   		 leaning_num == 1 `CLUSTER'
		eststo  mod_3: reg tmp	fair 	if 				   		 leaning_num == 2 `CLUSTER'
		eststo  lib_3: reg tmp	fair 	if 				   		 leaning_num == 3 `CLUSTER'

		#delim;
			esttab con_1 con_2 con_3 mod_1 mod_2 mod_3 lib_1 lib_2 lib_3 using "`TAB_A10_3'", append 
				 noobs nocons label compress nonotes
				 nonumber nomtitles
			/*	 stats(N, fmt(%7.0fc) labels("Num. obs."))  */
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						    b(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) star)
							b(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 0  1 1 0  1 1 0 ) par)
						 se(fmt(3) pattern(0 0 1  0 0 1  0 0 1 ) par)
					   "
					  )
				 collabels(none)
				 addnotes("*** p<0.01; ** p<0.05; * p<0.10.")  
				;
		#delim cr	
	restore

	** footnotes: equality of the discriminatee race effect (i.e., the Black treatment) between moderates and liberals
	reg fair black lib black_lib if lib == 1 |mod == 1 `CLUSTER'
	loc INT_PValues1: di %6.3f r(table)[4,3] // p = 0.880
	di "Footnote: A test for equality of the discriminatee race effect (i.e., the Black treatment) between moderate and liberal respondents yields p =`INT_PValues1'." 

	** footnotes: equality between conservatives and (moderates + liberals) 
	reg fair black lib2 black_lib2 `CLUSTER'
	loc INT_PValues2: di %6.3f r(table)[4,3] // p = 0.003
	di "Footnote: A test for equality of the discriminatee race effect between conservatives and (moderates + liberals) yields p =`INT_PValues2'."

	** footnotes: equality of the Less versus More Justifiability Gap across Conservatives, Moderates, and Liberals
	qui reg fair low_just if conserv == 1
		est store a
	qui reg fair low_just if mod == 1
		est store b
	qui reg fair low_just if lib == 1
		est store c 
	suest a b c `CLUSTER'
	test [a_mean]low_just = [b_mean]low_just = [c_mean]low_just
	loc EQUAL_PValues: di %6.3f `r(p)'  //p = 0.808
	di "Footnote: A test for equality of the Less versus More Justifiability Gap across Conservatives, Moderates, and Liberals yields p =`EQUAL_PValues'."
	

	
/* Table A10.4: Replicates Table 3 for 'Thoughtful' Subjects Only
-------------------------------------------------------------------------------	*/
use `DATA_REG', replace

	keep if stage_one == 1
	
	keep if thoughtful == 1

	loc CLUSTER ", vce(cluster randomid)"

	estimates clear
	
	preserve
		lab var bro "BRO"
		eststo bro1: mean bro if leaning_num == 1 `CLUSTER'
		eststo bro2: mean bro if leaning_num == 2 `CLUSTER'
		eststo bro3: mean bro if leaning_num == 3 `CLUSTER'


		** footnotes: equality of the Less versus More Justifiability Gap across Conservatives, Moderates, and Liberals
		reg bro conserv if lib == 0 `CLUSTER'
		loc P_CON_MOD: di %6.3f r(table)[4,1] // p = 0.003
		
		reg bro mod  if conserv == 0 `CLUSTER'
		loc P_MOD_LIB: di %6.3f r(table)[4,1] // p = 0.145 

		reg bro lib if mod == 0 `CLUSTER'
		loc P_LIB_CON: di %6.3f r(table)[4,1] // p = 0.000

		qui reg bro conserv if lib == 0
			est store a
		qui reg bro mod if conserv == 0
			est store b
		qui reg bro lib if mod == 0
			est store c
		suest a b c `CLUSTER'
		test [a_lnvar]_cons = [b_lnvar]_cons = [c_lnvar]_cons
		loc P_THREE: di %6.3f `r(p)'	// p = 0.672
		
		#delim;
			esttab bro* using "`TAB_A10_4'", replace 
				 nocons label compress nonotes
				 stats(N, fmt(%7.0fc) labels("Num. obs."))
				 star(* 0.10 ** 0.05 *** 0.01)
				 cells("
						  b(fmt(3) pattern(1 1 1) star)
					   "
					   "
						 se(fmt(3) pattern(1 1 1) par)
					   "
					  )
				 title("Table A10.4: Respondents' Perception of Black People's Relative Economic Opportunities (BRO) by Political Leaning: 'Thoughtful' Subjects Only")
				 mtitles("Conservatives" "Moderates" "Liberals")
				 collabels(none)
				 mgroups("Political Leaning",              
						pattern(1 0 0))
				 addnotes(" " 
				 "*** p<0.01; ** p<0.05; * p<0.10."
				 "Notes: BRO is the respondent's assessment of Black peoples' relative economic opportunity on a scale of -3 (much less) to 3 (much more). Results are based on Stage 1 observations only. p-values are clustered by respondent." ""
				 "p-values for tests of equality are:"
				 "    Conservatives vs. Moderates: p=`P_CON_MOD';"
				 "    Moderates vs. Liberals: p=`P_MOD_LIB';"
				 "    Liberals vs. Conservatives: p=`P_LIB_CON';"
				 "    Across all three political groups: p=`P_THREE'."
				 )  
				;
		#delim cr	
	restore 



/* OTHER RESULTS
------------------------------------------------------------------------------- */
use `DATA_REG', replace

	gen wb_switcher = (white1 == 1 & black2 == 1)
	gen bw_switcher = (black1 == 1 & white2 == 1)

	gen ts_switcher = (taste1 == 1 & stat2 == 1)
	gen st_switcher = (stat1 == 1 & taste2 == 1)
	
********* Section A3.2.2: Comparing the different race treatment switchers

reg fair stage_two if ts_switcher == 1
est sto ts
* T-S switchers travel an average of -0.113 fairness points (p = 0.288 -- if you include cluster option for randomid)

reg fair stage_two if st_switcher == 1
est sto st
* S-T switchers travel an average of -0.091 fairness points (p = 0.344 -- if you include cluster option for randomid)

suest ts st, cluster(randomid)
test [ts_mean]stage_two = [st_mean]stage_two
* p = 0.879 (test of equality in the above fairness ratings)


********* Section A3.4.2: Comparing the different race treatment switchers

reg fair stage_two if bw_switcher == 1
est sto bw
* B-W switchers travel an average of 0.243 fairness points (p = 0.005 -- if you include cluster option for randomid)

reg fair stage_two if wb_switcher == 1
est sto wb
* W-B switchers travel an average of -0.381 fairness points (p = 0.000 -- if you include cluster option for randomid)

suest bw wb, cluster(randomid)
test [bw_mean]stage_two = [wb_mean]stage_two
* p = 0.000 (test of equality in the above fairness ratings)


************ Prepare values for Section A7.3 and A7.4 (will be used in R codes)

	** Group 1 & 2 distinctions **
	gen advocates = (((mod == 1 | lib == 1) & bro >= 0) | conserv == 1)
	gen utilitarians = ((mod == 1 | lib == 1) & bro < 0)

preserve 

	keep if utilitarians == 1

	reg fair white if bw_switcher == 1
	est sto bw
	* B-W switchers travel an average of 0.604 fairness points (p = .001)

	reg fair black if wb_switcher == 1
	est sto wb
	* W-B switchers travel an average of -0.626 fairness points (p = .000)

	gen group = 0
	replace group = 1 if wb_switcher == 1 & stage_two == 1
	replace group = 2 if bw_switcher == 1 & stage_two == 1
	replace group = 3 if black == 1 & stage_one == 1
	replace group = 4 if black == 0 & stage_one == 1 

	gen dummy1 = (group == 1)
	gen dummy2 = (group == 2)

	reg fair dummy1 if group == 1 | group == 3, cluster(randomid)
	* p = .004 (test if alpha = 1 for wb switchers)
	reg fair dummy1 if group == 1 | group == 4, cluster(randomid)
	* p = .000 (test if alpha = 0 for wb switchers)

	reg fair dummy2 if group == 2 | group == 4, cluster(randomid)
	* p = .098 (test if alpha = 1 for bw switchers)
	reg fair dummy2 if group == 2 | group == 3, cluster(randomid)
	* p = .000 (test if alpha = 0 for bw switchers)

	* This estimates B2 (i.e., Stage 2 mean fairness of wb switchers)
	reg fair if group == 1
	est store B2

	* This estimates W2 (i.e., Stage 2 mean fairness of bw switchers)
	reg fair if group == 2
	est store W2

	* This estimates B1* (i.e., Stage 1 mean fairness of everyone with Black treatment)
	reg fair if group == 3
	est store B1

	* This estimates W1* (i.e., Stage 1 mean fairness of everyone with White treatment)
	reg fair if group == 4
	est store W1

	suest B2 W2 B1 W1, cluster(randomid)

	matrix list e(V)
	matrix V = e(V)


// -- Below are the values used in alpha_appendix_A7_3.R

	di "b2 = " [B2_mean]_cons
	di "w2 = " [W2_mean]_cons
	di "b1 = " [B1_mean]_cons
	di "w1 = " [W1_mean]_cons
	di "v_b2 = " V["B2_mean:_cons", "B2_mean:_cons"]
	di "v_w2 = " V["W2_mean:_cons", "W2_mean:_cons"]
	di "v_b1 = " V["B1_mean:_cons", "B1_mean:_cons"]
	di "v_w1 = " V["W1_mean:_cons", "W1_mean:_cons"]
	di "v_b2_w2 = " V["B2_mean:_cons", "W2_mean:_cons"]
	di "v_b2_b1 = " V["B2_mean:_cons", "B1_mean:_cons"]
	di "v_b2_w1 = " V["B2_mean:_cons", "W1_mean:_cons"]
	di "v_w2_b1 = " V["W2_mean:_cons", "B1_mean:_cons"]
	di "v_w2_w1 = " V["W2_mean:_cons", "W1_mean:_cons"]
	di "v_b1_w1 = " V["B1_mean:_cons", "W1_mean:_cons"]

// -- Above are the values used in alpha_appendix_A7_3.R


	test [B2_mean]_cons = 0.5*[B1_mean]_cons + 0.5*[W1_mean]_cons
	* p = .969 (test alpha = 0.5 for wb switchers)

	test [W2_mean]_cons = 0.5*[W1_mean]_cons + 0.5*[B1_mean]_cons 
	* p = .220 (test alpha = 0.5 for bw switchers)

restore

	
	** Moderates & Liberals **

preserve 

	keep if mod == 1 | lib == 1

	reg fair white if bw_switcher == 1
	est sto bw
	* B-W switchers travel an average of 0.243 fairness points (p = .005)

	reg fair black if wb_switcher == 1
	est sto wb
	* W-B switchers travel an average of -0.381 fairness points (p = .000)

	gen group = 0
	replace group = 1 if wb_switcher == 1 & stage_two == 1
	replace group = 2 if bw_switcher == 1 & stage_two == 1
	replace group = 3 if black == 1 & stage_one == 1
	replace group = 4 if black == 0 & stage_one == 1 

	gen dummy1 = (group == 1)
	gen dummy2 = (group == 2)

	reg fair dummy1 if group == 1 | group == 3, cluster(randomid)
	* p = .007 (test if alpha = 1 for wb switchers)
	reg fair dummy1 if group == 1 | group == 4, cluster(randomid)
	* p = .003 (test if alpha = 0 for wb switchers)

	reg fair dummy2 if group == 2 | group == 4, cluster(randomid)
	* p = .067 (test if alpha = 1 for bw switchers)
	reg fair dummy2 if group == 2 | group == 3, cluster(randomid)
	* p = .000 (test if alpha = 0 for bw switchers)

	* This estimates B2 (i.e., Stage 2 mean fairness of wb switchers)
	reg fair if group == 1
	est store B2

	* This estimates W2 (i.e., Stage 2 mean fairness of bw switchers)
	reg fair if group == 2
	est store W2

	* This estimates B1* (i.e., Stage 1 mean fairness of everyone with Black treatment)
	reg fair if group == 3
	est store B1

	* This estimates W1* (i.e., Stage 1 mean fairness of everyone with White treatment)
	reg fair if group == 4
	est store W1

	suest B2 W2 B1 W1, cluster(randomid)
	matrix list e(V)
	matrix V = e(V)


// -- Below are the values used in alpha_appendix_A7_4.R

	di "b2 = " [B2_mean]_cons
	di "w2 = " [W2_mean]_cons
	di "b1 = " [B1_mean]_cons
	di "w1 = " [W1_mean]_cons
	di "v_b2 = " V["B2_mean:_cons", "B2_mean:_cons"]
	di "v_w2 = " V["W2_mean:_cons", "W2_mean:_cons"]
	di "v_b1 = " V["B1_mean:_cons", "B1_mean:_cons"]
	di "v_w1 = " V["W1_mean:_cons", "W1_mean:_cons"]
	di "v_b2_w2 = " V["B2_mean:_cons", "W2_mean:_cons"]
	di "v_b2_b1 = " V["B2_mean:_cons", "B1_mean:_cons"]
	di "v_b2_w1 = " V["B2_mean:_cons", "W1_mean:_cons"]
	di "v_w2_b1 = " V["W2_mean:_cons", "B1_mean:_cons"]
	di "v_w2_w1 = " V["W2_mean:_cons", "W1_mean:_cons"]
	di "v_b1_w1 = " V["B1_mean:_cons", "W1_mean:_cons"]

// -- Above are the values used in alpha_appendix_A7_4.R


	test [B2_mean]_cons = 0.5*[B1_mean]_cons + 0.5*[W1_mean]_cons
	* p = .678 (test alpha = 0.5 for wb switchers)

	test [W2_mean]_cons = 0.5*[W1_mean]_cons + 0.5*[B1_mean]_cons 
	* p = .423 (test alpha = 0.5 for bw switchers)

restore





		